Project Tiles has retired. For details please refer to its Attic page.
PatternDefinitionResolver xref
View Javadoc

1   /*
2    * $Id: PatternDefinitionResolver.java 1539385 2013-11-06 16:24:13Z mck $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.tiles.definition.pattern;
23  
24  import java.util.Map;
25  
26  import org.apache.tiles.Definition;
27  
28  /**
29   * Resolves a definition starting from patterns stored in definition maps.
30   *
31   * @param <T> The type of the customization key.
32   * @version $Rev: 1539385 $ $Date: 2013-11-07 03:24:13 +1100 (Thu, 07 Nov 2013) $
33   * @since 2.2.0
34   */
35  public interface PatternDefinitionResolver<T> {
36  
37      /**
38       * Stores definition patterns.
39       *
40       * @param localeDefsMap The map of definitions that may contain also
41       * patterns.
42       * @param customizationKey The customization key.
43       * @return The map of the definitions not recognized as containing
44       * definition patterns.
45       * @since 2.2.1
46       */
47      Map<String, Definition> storeDefinitionPatterns(Map<String, Definition> localeDefsMap,
48              T customizationKey);
49  
50      /**
51       * Resolves a definition searching in all patterns for the requested
52       * customization key.
53       *
54       * @param name The name of the definition.
55       * @param customizationKey The customization key.
56       * @return The resolved definition.
57       * @since 2.2.0
58       */
59      Definition resolveDefinition(String name, T customizationKey);
60  
61      /**
62       * Used to clear all entries in the localePatternPaths for a specific locale. Necessary when reloading definition
63       * files to ensure that the list is cleared first
64       * 
65       * @param customizationKey
66       */
67      public void clearPatternPaths(T customizationKey);
68  }