|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tiles.BasicAttributeContext
public class BasicAttributeContext
Basic implementation for AttributeContext
.
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,Attribute> |
attributes
Template attributes. |
protected java.util.Map<java.lang.String,Attribute> |
cascadedAttributes
Cascaded template attributes. |
protected java.lang.String |
preparer
Associated ViewPreparer URL or classname, if defined. |
protected java.util.Set<java.lang.String> |
roles
The roles that can render this definition. |
protected java.lang.String |
template
Template path. |
Constructor Summary | |
---|---|
BasicAttributeContext()
Constructor. |
|
BasicAttributeContext(AttributeContext context)
Copy constructor. |
|
BasicAttributeContext(BasicAttributeContext context)
Copy constructor. |
|
BasicAttributeContext(java.util.Map<java.lang.String,Attribute> attributes)
Constructor. |
Method Summary | |
---|---|
void |
addAll(java.util.Map<java.lang.String,Attribute> newAttributes)
Add all attributes to this context. |
void |
addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)
Add all missing attributes to this context. |
void |
clear()
Clear the attributes. |
Attribute |
getAttribute(java.lang.String name)
Retrieve the named attribute, either cascaded or not. |
java.util.Iterator<java.lang.String> |
getAttributeNames()
Iterator of all attribute names. |
Attribute |
getCascadedAttribute(java.lang.String name)
Retrieve the attribute that has been cascaded at upper levels. |
java.util.Set<java.lang.String> |
getCascadedAttributeNames()
Returns the names of the cascaded attributes. |
Attribute |
getLocalAttribute(java.lang.String name)
Retrieve the attribute that has been defined in this context (i.e. not cascaded). |
java.util.Set<java.lang.String> |
getLocalAttributeNames()
Returns the names of the local attributes, i.e. the one that have not been cascaded. |
java.lang.String |
getPreparer()
Get associated preparer instance. |
java.lang.String |
getRole()
Access method for the role property. |
java.util.Set<java.lang.String> |
getRoles()
Returns the roles that can render this attribute. |
java.lang.String |
getTemplate()
Access method for the template property. |
void |
inherit(AttributeContext parent)
Copies all missing attributes from the parent attribute
context to this one. |
void |
inherit(BasicAttributeContext parent)
Inherits the attribute context, inheriting, i.e. copying if not present, the attributes. |
void |
inheritCascadedAttributes(AttributeContext context)
Copies the cascaded attributes to this attribute context. |
void |
putAttribute(java.lang.String name,
Attribute value)
Add the specified attribute. |
void |
putAttribute(java.lang.String name,
Attribute value,
boolean cascade)
Add the specified attribute. |
void |
setPreparer(java.lang.String url)
Set associated preparer instance. |
void |
setRole(java.lang.String role)
Sets the value of the role property. |
void |
setRoles(java.util.Set<java.lang.String> roles)
Sets the roles that can render this attribute. |
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 |
---|
protected java.lang.String template
protected java.util.Set<java.lang.String> roles
protected java.lang.String preparer
protected java.util.Map<java.lang.String,Attribute> attributes
protected java.util.Map<java.lang.String,Attribute> cascadedAttributes
Constructor Detail |
---|
public BasicAttributeContext()
public BasicAttributeContext(java.util.Map<java.lang.String,Attribute> attributes)
attributes
- Attributes to initialize context.public BasicAttributeContext(AttributeContext context)
context
- The constructor to copy.public BasicAttributeContext(BasicAttributeContext context)
context
- The constructor to copy.Method Detail |
---|
public java.lang.String getTemplate()
getTemplate
in interface AttributeContext
public void setTemplate(java.lang.String template)
setTemplate
in interface AttributeContext
template
- the new value of the path propertypublic java.lang.String getRole()
getRole
in interface AttributeContext
public java.util.Set<java.lang.String> getRoles()
getRoles
in interface AttributeContext
public void setRole(java.lang.String role)
setRole
in interface AttributeContext
role
- the new value of the role propertypublic void setRoles(java.util.Set<java.lang.String> roles)
setRoles
in interface AttributeContext
roles
- The enabled roles.public java.lang.String getPreparer()
getPreparer
in interface AttributeContext
public void setPreparer(java.lang.String url)
setPreparer
in interface AttributeContext
url
- The preparer name.public void inheritCascadedAttributes(AttributeContext context)
inheritCascadedAttributes
in interface AttributeContext
context
- The parent context to be used.public void inherit(AttributeContext parent)
parent
attribute
context to this one.
inherit
in interface AttributeContext
parent
- The attribute context to copy attributes from.public void inherit(BasicAttributeContext parent)
parent
- The attribute context to inherit.public void addAll(java.util.Map<java.lang.String,Attribute> newAttributes)
addAll
in interface AttributeContext
newAttributes
- Attributes to add.public void addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)
addMissing
in interface AttributeContext
defaultAttributes
- Attributes to add.public Attribute getAttribute(java.lang.String name)
getAttribute
in interface AttributeContext
name
- key name for the attribute.
public Attribute getLocalAttribute(java.lang.String name)
getLocalAttribute
in interface AttributeContext
name
- key name for the attribute.
null
otherwise.public Attribute getCascadedAttribute(java.lang.String name)
getCascadedAttribute
in interface AttributeContext
name
- key name for the attribute.
null
otherwise.public java.util.Iterator<java.lang.String> getAttributeNames()
getAttributeNames
in interface AttributeContext
public java.util.Set<java.lang.String> getLocalAttributeNames()
getLocalAttributeNames
in interface AttributeContext
public java.util.Set<java.lang.String> getCascadedAttributeNames()
getCascadedAttributeNames
in interface AttributeContext
public void putAttribute(java.lang.String name, Attribute value)
AttributeContext.putAttribute(String, Attribute, boolean)
with
cascade = false
.
putAttribute
in interface AttributeContext
name
- name of the attributevalue
- value of the attributepublic void putAttribute(java.lang.String name, Attribute value, boolean cascade)
putAttribute
in interface AttributeContext
name
- name of the attributevalue
- value of the attributecascade
- If true
, the attribute value will be
available in all nested contexts. If false
, it will be
available only in the current context.public void clear()
clear
in interface AttributeContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |