1/*2 * $Id: Definitions.java 663697 2008-06-05 18:53:08Z apetrelli $3 *4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122package org.apache.tiles.definition;
2324import java.util.Locale;
25import java.util.Map;
2627import org.apache.tiles.Definition;
2829/***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 the34 * collection, add and retrieve lcale-specific Definitions objects, and reset35 * 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 class40 * {@link DefinitionsImpl}.41 */42 @Deprecated
43publicinterfaceDefinitions {
4445/***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 none50 * is found.51 */52 Definition getDefinition(String name);
5354/***55 * Adds new Definition objects to the internal collection and56 * resolves inheritance attraibutes.57 *58 * @param defsMap The new definitions to add.59 * @throws NoSuchDefinitionException if a Definition extends from60 * one that doesn't exist.61 */62void addDefinitions(Map<String, Definition> defsMap);
6364/***65 * Adds new locale-specific Definition objects to the internal66 * 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 from71 * one that doesn't exist.72 */73void addDefinitions(Map<String, Definition> defsMap, Locale locale);
7475/***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 none81 * is found.82 */83 Definition getDefinition(String name, Locale locale);
8485/***86 * Resolves configuration inheritance properties.87 *88 * @throws NoSuchDefinitionException If parent definitions are not found.89 */90void resolveInheritances();
9192/***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 */98void resolveInheritances(Locale locale);
99100/***101 * Clears definitions.102 */103void reset();
104105/***106 * Returns base definitions collection.107 *108 * @return A map of the type "definition name -> definition".109 */110 Map<String, Definition> getBaseDefinitions();
111 }