Package org.apache.tiles
Class Definition
- java.lang.Object
-
- org.apache.tiles.BasicAttributeContext
-
- org.apache.tiles.Definition
-
- All Implemented Interfaces:
java.io.Serializable,AttributeContext
public class Definition extends BasicAttributeContext
A definition, i.e. a template with (completely or not) filled attributes. Attributes of a template can be defined with the help of this class.
It can be used as a data transfer object used for registering new definitions with the Container.- Since:
- Tiles 2.0
- Version:
- $Rev: 832840 $ $Date: 2009-11-05 05:44:25 +1100 (Thu, 05 Nov 2009) $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringinheritExtends attribute value.protected java.lang.StringnameDefinition name.-
Fields inherited from class org.apache.tiles.BasicAttributeContext
attributes, cascadedAttributes, preparer, templateAttribute
-
-
Constructor Summary
Constructors Constructor Description Definition()Constructor.Definition(java.lang.String name, Attribute templateAttribute, java.util.Map<java.lang.String,Attribute> attributes)Constructor.Definition(Definition definition)Copy Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetExtends()Get extends.java.lang.StringgetName()Access method for the name property.inthashCode()booleanisExtending()Get extends flag.voidsetExtends(java.lang.String name)Set extends.voidsetName(java.lang.String aName)Sets the value of the name property.java.lang.StringtoString()Returns a description of the attributes.-
Methods inherited from class org.apache.tiles.BasicAttributeContext
addAll, addMissing, clear, getAttribute, getCascadedAttribute, getCascadedAttributeNames, getLocalAttribute, getLocalAttributeNames, getPreparer, getTemplateAttribute, inherit, inherit, inheritCascadedAttributes, putAttribute, putAttribute, setPreparer, setTemplateAttribute
-
-
-
-
Constructor Detail
-
Definition
public Definition()
Constructor.
-
Definition
public Definition(Definition definition)
Copy Constructor. Create a new definition initialized with parent definition. Do a shallow copy : attributes are shared between copies, but not the Map containing attributes.- Parameters:
definition- The definition to copy.
-
Definition
public Definition(java.lang.String name, Attribute templateAttribute, java.util.Map<java.lang.String,Attribute> attributes)Constructor.- Parameters:
name- The name of the definition.templateAttribute- The template attribute of the definition.attributes- The attribute map of the definition.- Since:
- 2.1.2
-
-
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
-
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.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classBasicAttributeContext
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBasicAttributeContext
-
isExtending
public boolean isExtending()
Get extends flag.- Returns:
trueif this definition extends another.
-
toString
public java.lang.String toString()
Returns a description of the attributes.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the content of this definition.
-
-