This project has retired. For details please refer to its Attic page.
Attribute (Tiles 2 2.0.7 API)

org.apache.tiles
Class Attribute

Package class diagram package Attribute
java.lang.Object
  extended by org.apache.tiles.Attribute
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ListAttribute

public class Attribute
extends Object
implements Serializable

Common implementation of attribute definition.

Version:
$Rev: 619574 $ $Date: 2008-02-07 20:09:33 +0100 (Thu, 07 Feb 2008) $
See Also:
Serialized Form

Nested Class Summary
static class Attribute.AttributeType
          Attribute types.
 
Field Summary
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)
          Constructor.
Attribute(String name, Object value)
          Constructor.
Attribute(String name, Object value, String role, Attribute.AttributeType type)
          Constructor.
 
Method Summary
 String getName()
          Deprecated. Use the getName methods in object that contain attributes.
 String getRole()
          Get role.
 Set<String> getRoles()
          Returns the roles that can render this attribute.
 Attribute.AttributeType getType()
          Returns the type of this attribute.
 Object getValue()
          Get value.
 void setBody(String body)
          Sets the body of this attribute.
 void setName(String name)
          Deprecated. Use the setName methods in object that contain attributes.
 void setRole(String role)
          Set role.
 void setRoles(Set<String> roles)
          Sets the roles that can render this attribute.
 void setType(Attribute.AttributeType type)
          Sets the type of this attribute.
 void setValue(Object value)
          Set value.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

roles

protected Set<String> roles
The roles that can render this attribute.

Since:
2.0.6

value

protected Object value
The value of the attribute.

Constructor Detail

Attribute

public Attribute()
Constructor.


Attribute

public Attribute(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(String name,
                 Object value)
Constructor.

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

Attribute

public Attribute(Object value,
                 String role)
Constructor.

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

Attribute

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

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

Attribute

public Attribute(String name,
                 Object value,
                 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 String getRole()
Get role.

Returns:
the name of the required role(s)

getRoles

public Set<String> getRoles()
Returns the roles that can render this attribute.

Returns:
The enabled roles.
Since:
2.0.6

setRole

public void setRole(String role)
Set role.

Parameters:
role - Associated role.

setRoles

public void setRoles(Set<String> roles)
Sets the roles that can render this attribute.

Parameters:
roles - The enabled roles.
Since:
2.0.6

getValue

public Object getValue()
Get value.

Returns:
the value

setValue

public void setValue(Object value)
Set value.

Parameters:
value - New value.

toString

public String toString()

Overrides:
toString in class 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

@Deprecated
public String getName()
Deprecated. Use the getName methods in object that contain attributes.

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

@Deprecated
public void setName(String name)
Deprecated. Use the setName methods in object that contain attributes.

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(String body)
Sets the body of this attribute.

Parameters:
body - The attribute body.


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.