This project has retired. For details please refer to its Attic page.
Definitions xref
View Javadoc

1   /*
2    * $Id: Definitions.java 663697 2008-06-05 18:53:08Z apetrelli $
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;
23  
24  import java.util.Locale;
25  import java.util.Map;
26  
27  import org.apache.tiles.Definition;
28  
29  /***
30   * Interface for managing collections of {@link Definition} objects. <p/>
31   * <p>
32   * The Definitions interface provides a pattern for managing Definition objects.
33   * Implementations will provide a means to append new Definitions to the
34   * collection, add and retrieve lcale-specific Definitions objects, and reset
35   * the collections.
36   * </p>
37   *
38   * @version $Rev: 663697 $ $Date: 2008-06-05 20:53:08 +0200 (gio, 05 giu 2008) $
39   * @deprecated This interface is never used, except in the deprecated class
40   * {@link DefinitionsImpl}.
41   */
42  @Deprecated
43  public interface Definitions {
44  
45      /***
46       * Returns a Definition object that matches the given name.
47       *
48       * @param name The name of the Definition to return.
49       * @return the Definition matching the given name or null if none
50       *         is found.
51       */
52      Definition getDefinition(String name);
53  
54      /***
55       * Adds new Definition objects to the internal collection and
56       * resolves inheritance attraibutes.
57       *
58       * @param defsMap The new definitions to add.
59       * @throws NoSuchDefinitionException if a Definition extends from
60       *                                   one that doesn't exist.
61       */
62      void addDefinitions(Map<String, Definition> defsMap);
63  
64      /***
65       * Adds new locale-specific Definition objects to the internal
66       * collection and resolves inheritance attraibutes.
67       *
68       * @param defsMap The new definitions to add.
69       * @param locale  The locale to add the definitions to.
70       * @throws NoSuchDefinitionException if a Definition extends from
71       *                                   one that doesn't exist.
72       */
73      void addDefinitions(Map<String, Definition> defsMap, Locale locale);
74  
75      /***
76       * Returns a Definition object that matches the given name and locale.
77       *
78       * @param name   The name of the Definition to return.
79       * @param locale The locale to use to resolve the definition.
80       * @return the Definition matching the given name or null if none
81       *         is found.
82       */
83      Definition getDefinition(String name, Locale locale);
84  
85      /***
86       * Resolves configuration inheritance properties.
87       *
88       * @throws NoSuchDefinitionException If parent definitions are not found.
89       */
90      void resolveInheritances();
91  
92      /***
93       * Resolves locale-specific configuration inheritance properties.
94       *
95       * @param locale The locale object to use.
96       * @throws NoSuchDefinitionException If parent definitions are not found.
97       */
98      void resolveInheritances(Locale locale);
99  
100     /***
101      * Clears definitions.
102      */
103     void reset();
104 
105     /***
106      * Returns base definitions collection.
107      *
108      * @return A map of the type "definition name -> definition".
109      */
110     Map<String, Definition> getBaseDefinitions();
111 }