public class Attribute extends Object implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
protected Expression |
expressionObject
The expression to evaluate.
|
protected Set<String> |
roles
The roles that can render this attribute.
|
protected Object |
value
The value of the attribute.
|
Constructor and Description |
---|
Attribute()
Constructor.
|
Attribute(Attribute attribute)
Copy constructor.
|
Attribute(Object value)
Constructor.
|
Attribute(Object value,
Expression expression,
String role,
String rendererName)
Constructor.
|
Attribute(Object value,
String role)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Attribute |
clone() |
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.
|
static Attribute |
createTemplateAttributeWithExpression(String templateExpression)
Creates a template attribute, starting from the expression to evaluate to
obtain the template.
|
boolean |
equals(Object obj) |
Expression |
getExpressionObject()
Returns The expression to evaluate.
|
String |
getRenderer()
Returns the renderer name to use.
|
String |
getRole()
Get role.
|
Set<String> |
getRoles()
Returns the roles that can render this attribute.
|
Object |
getValue()
Get value.
|
int |
hashCode() |
void |
inherit(Attribute attribute)
Inherits an attribute, i.e.
|
boolean |
isPermitted(org.apache.tiles.request.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 |
setRole(String role)
Set role.
|
void |
setRoles(Set<String> roles)
Sets the roles that can render this attribute.
|
void |
setValue(Object value)
Set value.
|
String |
toString() |
protected Object value
protected Expression expressionObject
value
is not
null
.public Attribute()
public Attribute(Object value)
value
- Object to store.public Attribute(Attribute attribute)
attribute
- The attribute to copy from.public Attribute(Object value, String role)
value
- Object to store.role
- Asociated role.public Attribute(Object value, Expression expression, String role, String rendererName)
value
- Object to store. If specified, the expression
parameter will be ignored.expression
- The expression to be evaluated. Ignored if the
value
is not null.role
- Associated role.rendererName
- The renderer name.public static Attribute createTemplateAttribute(String template)
template
- The template that will be rendered.public static Attribute createTemplateAttribute(String template, String templateExpression, String templateType, String role)
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 template
will be used.role
- The comma-separated roles for which the template is
authorized to be rendered.public static Attribute createTemplateAttributeWithExpression(String templateExpression)
templateExpression
- The expression to evaluate.public String getRole()
public Set<String> getRoles()
public void setRole(String role)
role
- Associated role.public void setRoles(Set<String> roles)
roles
- The enabled roles.public Object getValue()
public void setValue(Object value)
value
- New value.public Expression getExpressionObject()
value
is not
null
.public void setExpressionObject(Expression expressionObject)
value
is not
null
.expressionObject
- The expression to be evaluated.public String getRenderer()
public void setRenderer(String rendererName)
rendererName
- The renderer.public void inherit(Attribute attribute)
attribute
- The attribute to inherit.public boolean isPermitted(org.apache.tiles.request.Request request)
request
- The request context.true
if the current user can see this attribute.Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.