org.apache.tiles
Class Attribute

Package class diagram package Attribute
java.lang.Object
  extended by org.apache.tiles.Attribute
All Implemented Interfaces:
java.io.Serializable

public class Attribute
extends java.lang.Object
implements java.io.Serializable

Common implementation of attribute definition.

See Also:
Serialized Form

Nested Class Summary
static class Attribute.AttributeType
          Attribute types.
 
Field Summary
protected  java.lang.String role
          Role associated to this attribute.
protected  java.lang.Object value
          The value of the attribute.
 
Constructor Summary
Attribute()
          Constructor.
Attribute(Attribute attribute)
          Copy constructor.
Attribute(java.lang.Object value)
          Constructor.
Attribute(java.lang.Object value, java.lang.String role)
          Constructor.
Attribute(java.lang.Object value, java.lang.String role, Attribute.AttributeType type)
          Constructor.
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)
          Constructor.
 
Method Summary
 java.lang.String getName()
          Returns the name of the attribute.
 java.lang.String getRole()
          Get role.
 Attribute.AttributeType getType()
          Returns the type of this attribute.
 java.lang.Object getValue()
          Get value.
 void setBody(java.lang.String body)
          Sets the body of this attribute.
 void setName(java.lang.String name)
          Sets the name of the attribute.
 void setRole(java.lang.String role)
          Set role.
 void setType(Attribute.AttributeType type)
          Sets the type of this attribute.
 void setValue(java.lang.Object value)
          Set value.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

role

protected java.lang.String role
Role associated to this attribute.


value

protected java.lang.Object value
The value of the attribute.

Constructor Detail

Attribute

public Attribute()
Constructor.


Attribute

public Attribute(java.lang.Object value)
Constructor.

Parameters:
value - Object to store.

Attribute

public Attribute(Attribute attribute)
Copy constructor.

Parameters:
attribute - The attribute to copy from.

Attribute

public Attribute(java.lang.String name,
                 java.lang.Object value)
Constructor.

Parameters:
name - name of the attribute
value - Object to store.

Attribute

public Attribute(java.lang.Object value,
                 java.lang.String role)
Constructor.

Parameters:
value - Object to store.
role - Asociated role.

Attribute

public Attribute(java.lang.Object value,
                 java.lang.String role,
                 Attribute.AttributeType type)
Constructor.

Parameters:
value - Object to store.
role - Asociated role.
type - Attribute type.

Attribute

public Attribute(java.lang.String name,
                 java.lang.Object value,
                 java.lang.String role,
                 Attribute.AttributeType type)
Constructor.

Parameters:
name - name of the attribute
value - Object to store.
role - Asociated role.
type - Attribute type.
Method Detail

getRole

public java.lang.String getRole()
Get role.

Returns:
the name of the required role(s)

setRole

public void setRole(java.lang.String role)
Set role.

Parameters:
role - Associated role.

getValue

public java.lang.Object getValue()
Get value.

Returns:
the value

setValue

public void setValue(java.lang.Object value)
Set value.

Parameters:
value - New value.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getType

public Attribute.AttributeType getType()
Returns the type of this attribute.

Returns:
The attribute type. It can be string, template, definition, object.

setType

public void setType(Attribute.AttributeType type)
Sets the type of this attribute.

Parameters:
type - The attribute type.

getName

public java.lang.String getName()
Returns the name of the attribute.

Returns:
The name of the attribute. It can be null, but in this case it should be used as an element of ListAttribute

setName

public void setName(java.lang.String name)
Sets the name of the attribute.

Parameters:
name - The name of the attribute. It can be null, but in this case it should be used as an element of ListAttribute

setBody

public void setBody(java.lang.String body)
Sets the body of this attribute.

Parameters:
body - The attribute body.