1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 }