public interface AttributeContext
Modifier and Type | Method and Description |
---|---|
void |
addAll(Map<String,Attribute> newAttributes)
Add all attributes to the context.
|
void |
addMissing(Map<String,Attribute> defaultAttributes)
Add all attributes to the context.
|
void |
clear()
Clear the attributes.
|
Attribute |
getAttribute(String name)
Retrieve the named attribute, either cascaded or not.
|
Attribute |
getCascadedAttribute(String name)
Retrieve the attribute that has been cascaded at upper levels.
|
Set<String> |
getCascadedAttributeNames()
Returns the names of the cascaded attributes.
|
Attribute |
getLocalAttribute(String name)
Retrieve the attribute that has been defined in this context (i.e.
|
Set<String> |
getLocalAttributeNames()
Returns the names of the local attributes, i.e.
|
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(String name,
Attribute value)
Add the specified attribute.
|
void |
putAttribute(String name,
Attribute value,
boolean cascade)
Add the specified attribute.
|
void |
setPreparer(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.String getPreparer()
void setPreparer(String url)
url
- The preparer name.void addAll(Map<String,Attribute> newAttributes)
newAttributes
- the attributes to be added.void addMissing(Map<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(String name)
name
- key name for the attribute.Attribute getLocalAttribute(String name)
name
- key name for the attribute.null
otherwise.Attribute getCascadedAttribute(String name)
name
- key name for the attribute.null
otherwise.Set<String> getLocalAttributeNames()
Set<String> getCascadedAttributeNames()
void putAttribute(String name, Attribute value)
putAttribute(String, Attribute, boolean)
with
cascade = false
.name
- name of the attributevalue
- value of the attributevoid putAttribute(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()
Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.