Package org.apache.tiles.api
Class BasicAttributeContext
java.lang.Object
org.apache.tiles.api.BasicAttributeContext
- All Implemented Interfaces:
- Serializable,- AttributeContext
- Direct Known Subclasses:
- Definition
Basic implementation for 
AttributeContext.- Since:
- 2.1.0
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor.BasicAttributeContext(Map<String, Attribute> attributes) Constructor.BasicAttributeContext(AttributeContext context) Copy constructor.Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd all attributes to this context.voidclear()Clear the attributes.booleangetAttribute(String name) Retrieve the named attribute, either cascaded or not.getCascadedAttribute(String name) Retrieve the attribute that has been cascaded at upper levels.Returns the names of the cascaded attributes.getLocalAttribute(String name) Retrieve the attribute that has been defined in this context (i.e.Returns the names of the local attributes, i.e.Get associated preparer instance.Returns the attribute that will be used to render a template.inthashCode()voidinherit(AttributeContext parent) Copies all missing attributes from theparentattribute context to this one.voidinherit(BasicAttributeContext parent) Inherits the attribute context, inheriting, i.e.voidCopies the cascaded attributes to this attribute context.voidputAttribute(String name, Attribute value) Add the specified attribute.voidputAttribute(String name, Attribute value, boolean cascade) Add the specified attribute.voidsetPreparer(String url) Set associated preparer instance.voidsetTemplateAttribute(Attribute templateAttribute) Sets the template attribute, that will be used to render the template page.
- 
Field Details- 
templateAttributeThe template attribute, to render a template.- Since:
- 2.1.2
 
- 
preparerAssociated ViewPreparer URL or classname, if defined.- Since:
- 2.1.0
 
- 
attributesTemplate attributes.- Since:
- 2.1.0
 
- 
cascadedAttributesCascaded template attributes.- Since:
- 2.1.0
 
 
- 
- 
Constructor Details- 
BasicAttributeContextpublic BasicAttributeContext()Constructor.- Since:
- 2.1.0
 
- 
BasicAttributeContextConstructor. Create a context and set specified attributes.- Parameters:
- attributes- Attributes to initialize context.
- Since:
- 2.1.0
 
- 
BasicAttributeContextCopy constructor.- Parameters:
- context- The constructor to copy.
- Since:
- 2.1.0
 
- 
BasicAttributeContextCopy constructor.- Parameters:
- context- The constructor to copy.
- Since:
- 2.1.0
 
 
- 
- 
Method Details- 
getTemplateAttributeReturns the attribute that will be used to render a template.- Specified by:
- getTemplateAttributein interface- AttributeContext
- Returns:
- The template attribute.
 
- 
setTemplateAttributeSets the template attribute, that will be used to render the template page.- Specified by:
- setTemplateAttributein interface- AttributeContext
- Parameters:
- templateAttribute- The template attribute.
 
- 
getPreparerGet associated preparer instance.- Specified by:
- getPreparerin interface- AttributeContext
- Returns:
- The preparer name.
 
- 
setPreparerSet associated preparer instance.- Specified by:
- setPreparerin interface- AttributeContext
- Parameters:
- url- The preparer name.
 
- 
inheritCascadedAttributesCopies the cascaded attributes to this attribute context.- Specified by:
- inheritCascadedAttributesin interface- AttributeContext
- Parameters:
- context- The parent context to be used.
 
- 
inheritCopies all missing attributes from theparentattribute context to this one.- Specified by:
- inheritin interface- AttributeContext
- Parameters:
- parent- The attribute context to copy attributes from.
 
- 
inheritInherits the attribute context, inheriting, i.e. copying if not present, the attributes.- Parameters:
- parent- The attribute context to inherit.
- Since:
- 2.1.0
 
- 
addAllAdd all attributes to this context. Copies all the mappings from the specified attribute map to this context. New attribute mappings will replace any mappings that this context had for any of the keys currently in the specified attribute map.- Specified by:
- addAllin interface- AttributeContext
- Parameters:
- newAttributes- Attributes to add.
- Since:
- 2.1.0
 
- 
getAttributeRetrieve the named attribute, either cascaded or not.- Specified by:
- getAttributein interface- AttributeContext
- Parameters:
- name- key name for the attribute.
- Returns:
- Attribute associated with the given name.
 
- 
getLocalAttributeRetrieve the attribute that has been defined in this context (i.e. not cascaded).- Specified by:
- getLocalAttributein interface- AttributeContext
- Parameters:
- name- key name for the attribute.
- Returns:
- Attribute The local attribute associated with the given name, if
 present, or nullotherwise.
 
- 
getCascadedAttributeRetrieve the attribute that has been cascaded at upper levels.- Specified by:
- getCascadedAttributein interface- AttributeContext
- Parameters:
- name- key name for the attribute.
- Returns:
- Attribute The cascaded attribute associated with the given name,
 if present, or nullotherwise.
 
- 
getLocalAttributeNamesReturns the names of the local attributes, i.e. the one that have not been cascaded.- Specified by:
- getLocalAttributeNamesin interface- AttributeContext
- Returns:
- The local attribute names.
 
- 
getCascadedAttributeNamesReturns the names of the cascaded attributes.- Specified by:
- getCascadedAttributeNamesin interface- AttributeContext
- Returns:
- The cascaded attribute names.
 
- 
putAttributeAdd the specified attribute. The attribute value will be available only in the current context, i.e. it is like callingAttributeContext.putAttribute(String, Attribute, boolean)withcascade = false.- Specified by:
- putAttributein interface- AttributeContext
- Parameters:
- name- name of the attribute
- value- value of the attribute
 
- 
putAttributeAdd the specified attribute.- Specified by:
- putAttributein interface- AttributeContext
- Parameters:
- name- name of the attribute
- value- value of the attribute
- cascade- If- true, the attribute value will be available in all nested contexts. If- false, it will be available only in the current context.
 
- 
clearpublic void clear()Clear the attributes.- Specified by:
- clearin interface- AttributeContext
 
- 
equals
- 
hashCodepublic int hashCode()
 
-