public interface AttributeContext
Modifier and Type | Method and Description |
---|---|
void |
addAll(java.util.Map<java.lang.String,Attribute> newAttributes)
Add all attributes to the context.
|
void |
addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)
Add all attributes to the 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()
Deprecated.
|
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.
|
java.util.Set<java.lang.String> |
getLocalAttributeNames()
Returns the names of the local attributes, i.e.
|
java.lang.String |
getPreparer()
Get associated preparer instance.
|
Attribute |
getTemplateAttribute()
Returns the attribute that will be used to render a template.
|
void |
inherit(AttributeContext parent)
Copies all missing attributes from the
parent attribute
context to this one. |
void |
inheritCascadedAttributes(AttributeContext parent)
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 |
setTemplateAttribute(Attribute templateAttribute)
Sets the template attribute, that will be used to render the template
page.
|
Attribute getTemplateAttribute()
void setTemplateAttribute(Attribute templateAttribute)
templateAttribute
- The template attribute.java.lang.String getPreparer()
void setPreparer(java.lang.String url)
url
- The preparer name.void addAll(java.util.Map<java.lang.String,Attribute> newAttributes)
newAttributes
- the attributes to be added.void addMissing(java.util.Map<java.lang.String,Attribute> defaultAttributes)
defaultAttributes
- attributes which should be present.void inheritCascadedAttributes(AttributeContext parent)
parent
- The parent context to be used.void inherit(AttributeContext parent)
parent
attribute
context to this one.parent
- The attribute context to copy attributes from.Attribute getAttribute(java.lang.String name)
name
- key name for the attribute.Attribute getLocalAttribute(java.lang.String name)
name
- key name for the attribute.null
otherwise.Attribute getCascadedAttribute(java.lang.String name)
name
- key name for the attribute.null
otherwise.@Deprecated java.util.Iterator<java.lang.String> getAttributeNames()
getLocalAttributeNames()
or
getCascadedAttributeNames()
.java.util.Set<java.lang.String> getLocalAttributeNames()
java.util.Set<java.lang.String> getCascadedAttributeNames()
void putAttribute(java.lang.String name, Attribute value)
putAttribute(String, Attribute, boolean)
with
cascade = false
.name
- name of the attributevalue
- value of the attributevoid putAttribute(java.lang.String name, Attribute value, boolean cascade)
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.void clear()