org.apache.tiles.mgmt
Class TileDefinition

Package class diagram package TileDefinition
java.lang.Object
  extended by org.apache.tiles.mgmt.TileDefinition
Direct Known Subclasses:
Definition

public class TileDefinition
extends java.lang.Object

Data transfer object used for registering new definitions with the Container.

Since:
Tiles 2.0

Field Summary
protected  java.util.Map<java.lang.String,Attribute> attributes
          Attributes defined for the definition.
protected  java.lang.String inherit
          Extends attribute value.
protected  java.lang.String name
          TileDefinition name
protected  java.lang.String preparer
          Associated ViewPreparer URL or classname, if defined
protected  java.lang.String role
          Role associated to definition.
protected  java.lang.String template
          Template path.
 
Constructor Summary
TileDefinition()
          Constructor.
 
Method Summary
 void addAttribute(Attribute attribute)
          Add an attribute to this definition.
 java.lang.Object getAttribute(java.lang.String key)
          Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 java.util.Map<java.lang.String,Attribute> getAttributes()
          Access method for the attributes property.
 java.lang.String getExtends()
          Get extends.
 java.lang.String getName()
          Access method for the name property.
 java.lang.String getPreparer()
          Get associated preparerInstance
 java.lang.String getRole()
          Access method for the role property.
 java.lang.String getTemplate()
          Access method for the template property.
 void putAttribute(java.lang.String key, Attribute value)
          Put a new attribute in this definition.
 void setExtends(java.lang.String name)
          Set extends.
 void setName(java.lang.String aName)
          Sets the value of the name property.
 void setPreparer(java.lang.String url)
          Set associated preparerInstance URL.
 void setRole(java.lang.String role)
          Sets the value of the role property.
 void setTemplate(java.lang.String template)
          Sets the value of the template property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inherit

protected java.lang.String inherit
Extends attribute value.


name

protected java.lang.String name
TileDefinition name


template

protected java.lang.String template
Template path.


attributes

protected java.util.Map<java.lang.String,Attribute> attributes
Attributes defined for the definition.


role

protected java.lang.String role
Role associated to definition.


preparer

protected java.lang.String preparer
Associated ViewPreparer URL or classname, if defined

Constructor Detail

TileDefinition

public TileDefinition()
Constructor.

Method Detail

getName

public java.lang.String getName()
Access method for the name property.

Returns:
the current value of the name property

setName

public void setName(java.lang.String aName)
Sets the value of the name property.

Parameters:
aName - the new value of the name property

getTemplate

public java.lang.String getTemplate()
Access method for the template property.

Returns:
the current value of the template property

setTemplate

public void setTemplate(java.lang.String template)
Sets the value of the template property.

Parameters:
template - the new value of the path property

getRole

public java.lang.String getRole()
Access method for the role property.

Returns:
the current value of the role property

setRole

public void setRole(java.lang.String role)
Sets the value of the role property.

Parameters:
role - the new value of the path property

getAttributes

public java.util.Map<java.lang.String,Attribute> getAttributes()
Access method for the attributes property. If there is no attributes, return an empty map.

Returns:
the current value of the attributes property

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Parameters:
key - name of the attribute
Returns:
requested attribute or null if not found

putAttribute

public void putAttribute(java.lang.String key,
                         Attribute value)
Put a new attribute in this definition.

Parameters:
key - String key for attribute
value - Attibute value.

addAttribute

public void addAttribute(Attribute attribute)
Add an attribute to this definition.

This method is used by Digester to load definitions.

Parameters:
attribute - Attribute to add.

getPreparer

public java.lang.String getPreparer()
Get associated preparerInstance

Returns:
The preparer name.

setPreparer

public void setPreparer(java.lang.String url)
Set associated preparerInstance URL.

Parameters:
url - Url called locally

setExtends

public void setExtends(java.lang.String name)
Set extends.

Parameters:
name - Name of the extended definition.

getExtends

public java.lang.String getExtends()
Get extends.

Returns:
Name of the extended definition.