org.apache.tiles.impl.mgmt
Class DefinitionManager

Package class diagram package DefinitionManager
java.lang.Object
  extended by org.apache.tiles.impl.mgmt.DefinitionManager

public class DefinitionManager
extends java.lang.Object


Constructor Summary
DefinitionManager()
           
 
Method Summary
 void addDefinition(ComponentDefinition definition)
           
 ComponentDefinition getDefinition(java.lang.String definition, TilesRequestContext request)
           
 DefinitionsFactory getFactory()
           
protected  void overload(ComponentDefinition parent, ComponentDefinition child)
          Overloads a child definition with a given parent.
protected  void resolveInheritance(ComponentDefinition definition)
          Resolve inheritance.
 void setFactory(DefinitionsFactory factory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefinitionManager

public DefinitionManager()
Method Detail

getFactory

public DefinitionsFactory getFactory()

setFactory

public void setFactory(DefinitionsFactory factory)

getDefinition

public ComponentDefinition getDefinition(java.lang.String definition,
                                         TilesRequestContext request)
                                  throws DefinitionsFactoryException
Throws:
DefinitionsFactoryException

addDefinition

public void addDefinition(ComponentDefinition definition)
                   throws DefinitionsFactoryException
Throws:
DefinitionsFactoryException

resolveInheritance

protected void resolveInheritance(ComponentDefinition definition)
                           throws DefinitionsFactoryException
Resolve 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 - def
Throws:
NoSuchDefinitionException - If an inheritance can not be solved.
DefinitionsFactoryException

overload

protected void overload(ComponentDefinition parent,
                        ComponentDefinition child)
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.