|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.apache.tiles.Attribute
public class Attribute
Common implementation of attribute definition.
| Nested Class Summary | |
|---|---|
static class |
Attribute.AttributeType
Deprecated. Use setRenderer(String) and
getRenderer(). |
| Field Summary | |
|---|---|
protected String |
expression
The expression to evaluate. |
protected Set<String> |
roles
The roles that can render this attribute. |
protected Object |
value
The value of the attribute. |
| Constructor Summary | |
|---|---|
Attribute()
Constructor. |
|
Attribute(Attribute attribute)
Copy constructor. |
|
Attribute(Object value)
Constructor. |
|
Attribute(Object value,
String role)
Constructor. |
|
Attribute(Object value,
String role,
Attribute.AttributeType type)
Deprecated. Use Attribute(Object, String, String, String). |
|
Attribute(Object value,
String expression,
String role,
String rendererName)
Constructor. |
|
Attribute(String name,
Object value)
Constructor. |
|
Attribute(String name,
Object value,
String role,
Attribute.AttributeType type)
Deprecated. Use Attribute#Attribute(Object, String, String))). |
|
| Method Summary | |
|---|---|
Attribute |
clone()
|
static Attribute |
createTemplateAttribute(String template)
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. |
String |
getExpression()
Returns The expression to evaluate. |
String |
getName()
Deprecated. Use the getName methods in object that contain
attributes. |
String |
getRenderer()
Returns the renderer name to use. |
String |
getRole()
Get role. |
Set<String> |
getRoles()
Returns the roles that can render this attribute. |
Attribute.AttributeType |
getType()
Deprecated. Use getRenderer(). |
Object |
getValue()
Get value. |
void |
inherit(Attribute attribute)
Inherits an attribute, i.e. overwrites null properties with the ones provided by the attribute. |
void |
setBody(String body)
Sets the body of this attribute. |
void |
setExpression(String expression)
Sets The expression to evaluate. |
void |
setName(String name)
Deprecated. Use the setName methods in object that contain
attributes. |
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 |
setType(Attribute.AttributeType type)
Deprecated. Use Attribute#setRenderer(String)). |
void |
setValue(Object value)
Set value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Set<String> roles
protected Object value
protected String expression
value is not
null.
| Constructor Detail |
|---|
public Attribute()
public Attribute(Object value)
value - Object to store.public Attribute(Attribute attribute)
attribute - The attribute to copy from.
public Attribute(String name,
Object value)
name - name of the attributevalue - Object to store.
public Attribute(Object value,
String role)
value - Object to store.role - Asociated role.
@Deprecated
public Attribute(Object value,
String role,
Attribute.AttributeType type)
Attribute(Object, String, String, String).
value - Object to store.role - Associated role.type - Attribute type.
public Attribute(Object value,
String 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 Attribute(String name,
Object value,
String role,
Attribute.AttributeType type)
Attribute#Attribute(Object, String, String))).
name - name of the attributevalue - Object to store.role - Asociated role.type - Attribute type.| Method Detail |
|---|
public static Attribute createTemplateAttribute(String template)
template - The template that will 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 String getExpression()
value is not
null.
public void setExpression(String expression)
value is not
null.
expression - The expression to be evaluated.public String toString()
toString in class Objectpublic Attribute.AttributeType getType()
getRenderer().
string,
template, definition, object.public void setType(Attribute.AttributeType type)
Attribute#setRenderer(String)).
type - The attribute type.public String getRenderer()
public void setRenderer(String rendererName)
rendererName - The renderer.@Deprecated public 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(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(String body)
body - The attribute body.public void inherit(Attribute attribute)
attribute - The attribute to inherit.public Attribute clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||