Package org.apache.tiles.api
Class Attribute
java.lang.Object
org.apache.tiles.api.Attribute
- Direct Known Subclasses:
- ListAttribute
Common implementation of attribute definition.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncopy()static AttributecreateTemplateAttribute(String template) Creates a template attribute, starting from the name of the template.static AttributecreateTemplateAttribute(String template, String templateExpression, String templateType, String role) Creates a template attribute, starting from the name of the template.booleanReturns The expression to evaluate.Returns the renderer name to use.getRole()Get role.getRoles()Returns the roles that can render this attribute.getValue()Get value.inthashCode()voidInherits an attribute, i.e.booleanisPermitted(Request request) Checks if the current user can use this attribute.voidsetExpressionObject(Expression expressionObject) Sets The expression to evaluate.voidsetRenderer(String rendererName) Sets the renderer name to use.voidSet role.voidSets the roles that can render this attribute.voidSet value.toString()
- 
Constructor Details- 
Attributepublic Attribute()Constructor.
- 
AttributeConstructor.- Parameters:
- value- Object to store.
 
- 
AttributeCopy constructor.- Parameters:
- attribute- The attribute to copy from.
 
- 
AttributeConstructor.- Parameters:
- value- Object to store.
- role- Asociated role.
 
- 
AttributeConstructor.- Parameters:
- value- Object to store. If specified, the- expressionparameter will be ignored.
- expression- The expression to be evaluated. Ignored if the- valueis not null.
- role- Associated role.
- rendererName- The renderer name.
- Since:
- 2.2.0
 
 
- 
- 
Method Details- 
createTemplateAttributeCreates a template attribute, starting from the name of the template.- Parameters:
- template- The template that will be rendered.
- Returns:
- The template attribute.
- Since:
- 2.1.2
 
- 
createTemplateAttributepublic static Attribute createTemplateAttribute(String template, String templateExpression, String templateType, String role) Creates a template attribute, starting from the name of the template.- Parameters:
- template- The template that will be rendered.
- templateExpression- The template expression that will be evaluated to a template.
- templateType- The type, or renderer, of the template. If null, the default- templatewill be used.
- role- The comma-separated roles for which the template is authorized to be rendered.
- Returns:
- The template attribute.
- Since:
- 2.2.2
 
- 
getRoleGet role.- Returns:
- the name of the required role(s)
 
- 
getRolesReturns the roles that can render this attribute.- Returns:
- The enabled roles.
- Since:
- 2.0.6
 
- 
setRoleSet role.- Parameters:
- role- Associated role.
 
- 
setRolesSets the roles that can render this attribute.- Parameters:
- roles- The enabled roles.
- Since:
- 2.0.6
 
- 
getValueGet value.- Returns:
- the value
 
- 
setValueSet value.- Parameters:
- value- New value.
 
- 
getExpressionObjectReturns The expression to evaluate. Ignored ifvalueis notnull.- Returns:
- The expression to be evaluated.
- Since:
- 2.2.0
 
- 
setExpressionObjectSets The expression to evaluate. Ignored ifvalueis notnull.- Parameters:
- expressionObject- The expression to be evaluated.
- Since:
- 2.2.0
 
- 
toString
- 
getRendererReturns the renderer name to use.- Returns:
- The renderer name.
- Since:
- 2.1.0
 
- 
setRendererSets the renderer name to use.- Parameters:
- rendererName- The renderer.
- Since:
- 2.1.0
 
- 
inheritInherits an attribute, i.e. overwrites null properties with the ones provided by the attribute.- Parameters:
- attribute- The attribute to inherit.
- Since:
- 2.1.2
 
- 
equals
- 
isPermittedChecks if the current user can use this attribute.- Parameters:
- request- The request context.
- Returns:
- trueif the current user can see this attribute.
- Since:
- 3.0.0
 
- 
hashCodepublic int hashCode()
- 
copy
 
-