public class Attribute
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Class and Description |
|---|---|
static class |
Attribute.AttributeType
Deprecated.
Use
setRenderer(String) and
getRenderer(). |
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
expression
Deprecated.
Use
expressionObject. |
protected Expression |
expressionObject
The expression to evaluate.
|
protected java.util.Set<java.lang.String> |
roles
The roles that can render this attribute.
|
protected java.lang.Object |
value
The value of the attribute.
|
| Constructor and Description |
|---|
Attribute()
Constructor.
|
Attribute(Attribute attribute)
Copy constructor.
|
Attribute(java.lang.Object value)
Constructor.
|
Attribute(java.lang.Object value,
Expression expression,
java.lang.String role,
java.lang.String rendererName)
Constructor.
|
Attribute(java.lang.Object value,
java.lang.String role)
Constructor.
|
Attribute(java.lang.Object value,
java.lang.String role,
Attribute.AttributeType type)
Deprecated.
|
Attribute(java.lang.Object value,
java.lang.String expression,
java.lang.String role,
java.lang.String rendererName)
Deprecated.
|
Attribute(java.lang.String name,
java.lang.Object value)
Constructor.
|
Attribute(java.lang.String name,
java.lang.Object value,
java.lang.String role,
Attribute.AttributeType type)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
Attribute |
clone() |
static Attribute |
createTemplateAttribute(java.lang.String template)
Creates a template attribute, starting from the name of the template.
|
static Attribute |
createTemplateAttribute(java.lang.String template,
java.lang.String templateExpression,
java.lang.String templateType,
java.lang.String role)
Creates a template attribute, starting from the name of the template.
|
static Attribute |
createTemplateAttributeWithExpression(java.lang.String templateExpression)
Creates a template attribute, starting from the expression to evaluate to
obtain the template.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getExpression()
Deprecated.
|
Expression |
getExpressionObject()
Returns The expression to evaluate.
|
java.lang.String |
getName()
Deprecated.
Use the
getName methods in object that contain
attributes. |
java.lang.String |
getRenderer()
Returns the renderer name to use.
|
java.lang.String |
getRole()
Get role.
|
java.util.Set<java.lang.String> |
getRoles()
Returns the roles that can render this attribute.
|
Attribute.AttributeType |
getType()
Deprecated.
Use
getRenderer(). |
java.lang.Object |
getValue()
Get value.
|
int |
hashCode() |
void |
inherit(Attribute attribute)
Inherits an attribute, i.e.
|
void |
setBody(java.lang.String body)
Sets the body of this attribute.
|
void |
setExpression(java.lang.String expression)
Deprecated.
|
void |
setExpressionObject(Expression expressionObject)
Sets The expression to evaluate.
|
void |
setName(java.lang.String name)
Deprecated.
Use the
setName methods in object that contain
attributes. |
void |
setRenderer(java.lang.String rendererName)
Sets the renderer name to use.
|
void |
setRole(java.lang.String role)
Set role.
|
void |
setRoles(java.util.Set<java.lang.String> roles)
Sets the roles that can render this attribute.
|
void |
setType(Attribute.AttributeType type)
Deprecated.
Use
setRenderer(String). |
void |
setValue(java.lang.Object value)
Set value.
|
java.lang.String |
toString() |
protected java.util.Set<java.lang.String> roles
protected java.lang.Object value
protected java.lang.String expression
expressionObject.value is not
null.protected Expression expressionObject
value is not
null.public Attribute()
public Attribute(java.lang.Object value)
value - Object to store.public Attribute(Attribute attribute)
attribute - The attribute to copy from.public Attribute(java.lang.String name,
java.lang.Object value)
name - name of the attributevalue - Object to store.public Attribute(java.lang.Object value,
java.lang.String role)
value - Object to store.role - Asociated role.@Deprecated
public Attribute(java.lang.Object value,
java.lang.String role,
Attribute.AttributeType type)
Attribute(Object, String, String, String).value - Object to store.role - Associated role.type - Attribute type.public Attribute(java.lang.Object value,
java.lang.String expression,
java.lang.String role,
java.lang.String rendererName)
Attribute(Object, Expression, String, String).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 Attribute(java.lang.Object value,
Expression expression,
java.lang.String role,
java.lang.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 Attribute(java.lang.String name,
java.lang.Object value,
java.lang.String role,
Attribute.AttributeType type)
Attribute(Object, String, String, String).name - name of the attributevalue - Object to store.role - Asociated role.type - Attribute type.public static Attribute createTemplateAttribute(java.lang.String template)
template - The template that will be rendered.public static Attribute createTemplateAttribute(java.lang.String template, java.lang.String templateExpression, java.lang.String templateType, java.lang.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(java.lang.String templateExpression)
templateExpression - The expression to evaluate.public java.lang.String getRole()
public java.util.Set<java.lang.String> getRoles()
public void setRole(java.lang.String role)
role - Associated role.public void setRoles(java.util.Set<java.lang.String> roles)
roles - The enabled roles.public java.lang.Object getValue()
public void setValue(java.lang.Object value)
value - New value.public java.lang.String getExpression()
getExpressionObject().value is not
null.public void setExpression(java.lang.String expression)
setExpressionObject(Expression).value is not
null.expression - The expression to be evaluated.public Expression getExpressionObject()
value is not
null.public void setExpressionObject(Expression expressionObject)
value is not
null.expressionObject - The expression to be evaluated.public java.lang.String toString()
toString in class java.lang.Objectpublic Attribute.AttributeType getType()
getRenderer().string,
template, definition, object.public void setType(Attribute.AttributeType type)
setRenderer(String).type - The attribute type.public java.lang.String getRenderer()
public void setRenderer(java.lang.String rendererName)
rendererName - The renderer.@Deprecated public java.lang.String getName()
getName methods in object that contain
attributes.null, but in
this case it should be used as an element of ListAttribute@Deprecated public void setName(java.lang.String name)
setName methods in object that contain
attributes.name - The name of the attribute. It can be null,
but in this case it should be used as an element of
ListAttributepublic void setBody(java.lang.String body)
body - The attribute body.public void inherit(Attribute attribute)
attribute - The attribute to inherit.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Attribute clone()
clone in class java.lang.Object