This project has retired. For details please refer to its Attic page.
DefinitionsImpl (Tiles 2 2.2.2 API)

org.apache.tiles.definition
Class DefinitionsImpl

Package class diagram package DefinitionsImpl
java.lang.Object
  extended by org.apache.tiles.definition.DefinitionsImpl
All Implemented Interfaces:
Definitions

Deprecated. This class is, in fact, part of the implementation of UrlDefinitionsFactory and ResolvingLocaleUrlDefinitionDAO.

@Deprecated
public class DefinitionsImpl
extends Object
implements Definitions

Version:
$Rev: 791161 $ $Date: 2009-07-04 20:53:36 +0200 (sab, 04 lug 2009) $

Constructor Summary
DefinitionsImpl()
          Deprecated. Creates a new instance of DefinitionsImpl.
DefinitionsImpl(Map<String,Definition> baseDefinitions, Map<Locale,Map<String,Definition>> localeSpecificDefinitions)
          Deprecated. Creates a new instance of DefinitionsImpl to be used as a wrapper.
 
Method Summary
 void addDefinitions(Map<String,Definition> defsMap)
          Deprecated. Adds new Definition objects to the internal collection and resolves inheritance attraibutes.
 void addDefinitions(Map<String,Definition> defsMap, Locale locale)
          Deprecated. Adds new locale-specific Definition objects to the internal collection and resolves inheritance attraibutes.
 Map<String,Definition> getBaseDefinitions()
          Deprecated. Returns base definitions collection.
 Definition getDefinition(String name)
          Deprecated. Returns a Definition object that matches the given name.
 Definition getDefinition(String name, Locale locale)
          Deprecated. Returns a Definition object that matches the given name and locale.
protected  Definition getDefinitionByAttribute(Attribute attr, Locale locale)
          Deprecated. Searches for a definition specified as an attribute.
protected  void overload(Definition parent, Definition child)
          Deprecated. Use BasicAttributeContext.inherit(org.apache.tiles.AttributeContext).
 void reset()
          Deprecated. Clears definitions.
protected  void resolveInheritance(Definition definition, Locale locale, Set<String> alreadyResolvedDefinitions)
          Deprecated. Resolve locale-specific inheritance.
 void resolveInheritances()
          Deprecated. Resolve extended instances.
 void resolveInheritances(Locale locale)
          Deprecated. Resolve locale-specific extended instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinitionsImpl

public DefinitionsImpl()
Deprecated. 
Creates a new instance of DefinitionsImpl.


DefinitionsImpl

public DefinitionsImpl(Map<String,Definition> baseDefinitions,
                       Map<Locale,Map<String,Definition>> localeSpecificDefinitions)
Deprecated. 
Creates a new instance of DefinitionsImpl to be used as a wrapper.

Parameters:
baseDefinitions - The base definitions to use.
localeSpecificDefinitions - Maps a locale to a map of definitions.
Method Detail

getDefinition

public Definition getDefinition(String name)
Deprecated. 
Returns a Definition object that matches the given name.

Specified by:
getDefinition in interface Definitions
Parameters:
name - The name of the Definition to return.
Returns:
the Definition matching the given name or null if none is found.

addDefinitions

public void addDefinitions(Map<String,Definition> defsMap)
Deprecated. 
Adds new Definition objects to the internal collection and resolves inheritance attraibutes.

Specified by:
addDefinitions in interface Definitions
Parameters:
defsMap - The new definitions to add.
Throws:
NoSuchDefinitionException - If something goes wrong during addition.

addDefinitions

public void addDefinitions(Map<String,Definition> defsMap,
                           Locale locale)
Deprecated. 
Adds new locale-specific Definition objects to the internal collection and resolves inheritance attraibutes.

Specified by:
addDefinitions in interface Definitions
Parameters:
defsMap - The new definitions to add.
locale - The locale to add the definitions to.
Throws:
NoSuchDefinitionException - If something goes wrong during inheritance resolution.

getDefinition

public Definition getDefinition(String name,
                                Locale locale)
Deprecated. 
Returns a Definition object that matches the given name and locale.

Specified by:
getDefinition in interface Definitions
Parameters:
name - The name of the Definition to return.
locale - The locale to use to resolve the definition.
Returns:
the Definition matching the given name or null if none is found.

resolveInheritances

public void resolveInheritances()
Deprecated. 
Resolve extended instances.

Specified by:
resolveInheritances in interface Definitions
Throws:
NoSuchDefinitionException - If a parent definition is not found.

resolveInheritances

public void resolveInheritances(Locale locale)
Deprecated. 
Resolve locale-specific extended instances.

Specified by:
resolveInheritances in interface Definitions
Parameters:
locale - The locale to use.
Throws:
NoSuchDefinitionException - If a parent definition is not found.

reset

public void reset()
Deprecated. 
Clears definitions.

Specified by:
reset in interface Definitions

getBaseDefinitions

public Map<String,Definition> getBaseDefinitions()
Deprecated. 
Returns base definitions collection.

Specified by:
getBaseDefinitions in interface Definitions
Returns:
The base (i.e. not depending on any locale) definitions map.

getDefinitionByAttribute

protected Definition getDefinitionByAttribute(Attribute attr,
                                              Locale locale)
Deprecated. 
Searches for a definition specified as an attribute.

Parameters:
attr - The attribute to use.
locale - The locale to search into.
Returns:
The required definition if found, otherwise it returns null.

resolveInheritance

protected void resolveInheritance(Definition definition,
                                  Locale locale,
                                  Set<String> alreadyResolvedDefinitions)
Deprecated. 
Resolve locale-specific inheritance. First, resolve parent's inheritance, then set template to the parent's template. Also copy attributes setted in parent, and not set in child If instance doesn't extend anything, do nothing.

Parameters:
definition - The definition to resolve
locale - The locale to use.
alreadyResolvedDefinitions - The set of the definitions that have been already resolved.
Throws:
NoSuchDefinitionException - If an inheritance can not be solved.

overload

@Deprecated
protected void overload(Definition parent,
                                   Definition child)
Deprecated. Use BasicAttributeContext.inherit(org.apache.tiles.AttributeContext).

Overloads a child definition with a given parent. All attributes present in child are kept. All missing attributes are copied from the parent. Special attribute 'template','role' and 'extends' are overloaded in child if not defined

Parameters:
parent - The parent definition.
child - The child that will be overloaded.


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.