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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
static Attribute
createTemplateAttribute
(String template) Creates a template attribute, starting from the name of the template.static Attribute
createTemplateAttribute
(String template, String templateExpression, String templateType, String role) Creates a template attribute, starting from the name of the template.boolean
Returns 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.int
hashCode()
void
Inherits an attribute, i.e.boolean
isPermitted
(Request request) Checks if the current user can use this attribute.void
setExpressionObject
(Expression expressionObject) Sets The expression to evaluate.void
setRenderer
(String rendererName) Sets the renderer name to use.void
Set role.void
Sets the roles that can render this attribute.void
Set value.toString()
-
Constructor Details
-
Attribute
public Attribute()Constructor. -
Attribute
Constructor.- Parameters:
value
- Object to store.
-
Attribute
Copy constructor.- Parameters:
attribute
- The attribute to copy from.
-
Attribute
Constructor.- Parameters:
value
- Object to store.role
- Asociated role.
-
Attribute
Constructor.- Parameters:
value
- Object to store. If specified, theexpression
parameter will be ignored.expression
- The expression to be evaluated. Ignored if thevalue
is not null.role
- Associated role.rendererName
- The renderer name.- Since:
- 2.2.0
-
-
Method Details
-
createTemplateAttribute
Creates 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
-
createTemplateAttribute
public 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 defaulttemplate
will be used.role
- The comma-separated roles for which the template is authorized to be rendered.- Returns:
- The template attribute.
- Since:
- 2.2.2
-
getRole
Get role.- Returns:
- the name of the required role(s)
-
getRoles
Returns the roles that can render this attribute.- Returns:
- The enabled roles.
- Since:
- 2.0.6
-
setRole
Set role.- Parameters:
role
- Associated role.
-
setRoles
Sets the roles that can render this attribute.- Parameters:
roles
- The enabled roles.- Since:
- 2.0.6
-
getValue
Get value.- Returns:
- the value
-
setValue
Set value.- Parameters:
value
- New value.
-
getExpressionObject
Returns The expression to evaluate. Ignored ifvalue
is notnull
.- Returns:
- The expression to be evaluated.
- Since:
- 2.2.0
-
setExpressionObject
Sets The expression to evaluate. Ignored ifvalue
is notnull
.- Parameters:
expressionObject
- The expression to be evaluated.- Since:
- 2.2.0
-
toString
-
getRenderer
Returns the renderer name to use.- Returns:
- The renderer name.
- Since:
- 2.1.0
-
setRenderer
Sets the renderer name to use.- Parameters:
rendererName
- The renderer.- Since:
- 2.1.0
-
inherit
Inherits 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
-
isPermitted
Checks if the current user can use this attribute.- Parameters:
request
- The request context.- Returns:
true
if the current user can see this attribute.- Since:
- 3.0.0
-
hashCode
public int hashCode() -
copy
-