net.sourceforge.ajaxtags.helpers
Class AbstractItem

java.lang.Object
  extended by net.sourceforge.ajaxtags.helpers.AbstractItem
Direct Known Subclasses:
TreeItem, ValueItem

public abstract class AbstractItem
extends Object

A generic item class, basically representing a name-value pair. s


Constructor Summary
protected AbstractItem()
          Constructor for Item.
protected AbstractItem(String name, Object value, boolean asCData)
          Constructor for Item.
 
Method Summary
 void clearAttribute()
          Clear the attributes.
 Set<Object> getAttributeKeySet()
          List all attribute-names.
 String getAttributeValue(Object name)
          Read the attribute value.
 String getName()
           
 Object getValue()
          The type depends on the child-class.
 boolean isAsCData()
           
 void removeAttribute(String name)
          Removes an attribute.
 void setAllAttributes(Map<?,String> attributes)
          Set all attributes.
 void setAllAttributes(Map<?,String> attributes, boolean evenIfNull)
          Set all attributes.
 void setAsCData(boolean asCData)
           
 void setAttributes(Object name, String value)
          Set an attribute to extend the item.
 void setAttributes(Object name, String value, boolean evenIfNull)
          Set an attribute to extend the item.
 void setName(String name)
          Set the Name.
 void setValue(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractItem

protected AbstractItem(String name,
                       Object value,
                       boolean asCData)
Constructor for Item.

Parameters:
name - the name for the item
value - the value
asCData - response as CDATA

AbstractItem

protected AbstractItem()
Constructor for Item.

Method Detail

setAllAttributes

public final void setAllAttributes(Map<?,String> attributes,
                                   boolean evenIfNull)
Set all attributes.

Parameters:
attributes - the attributes to set
evenIfNull - set the attribute even if value is null

setAllAttributes

public final void setAllAttributes(Map<?,String> attributes)
Set all attributes.

Parameters:
attributes - the attributes to set

getAttributeKeySet

public Set<Object> getAttributeKeySet()
List all attribute-names.

Returns:
the key set of the attributes

removeAttribute

public final void removeAttribute(String name)
Removes an attribute.

Parameters:
name - the name of attribute

clearAttribute

public final void clearAttribute()
Clear the attributes.


setAttributes

public final void setAttributes(Object name,
                                String value)
Set an attribute to extend the item. This just invoke #setAttributes(String, String, boolean) with false as third parameter.

Parameters:
name - the name for the attribute
value - the value for the attribute
See Also:
#setAttributes(String, String, boolean)

setAttributes

public final void setAttributes(Object name,
                                String value,
                                boolean evenIfNull)
Set an attribute to extend the item.

Parameters:
name - the name for the attribute
value - the value for the attribute
evenIfNull - set attribute even if it is null

getAttributeValue

public String getAttributeValue(Object name)
Read the attribute value.

Parameters:
name - the attribute name
Returns:
the value of attribute name

getName

public String getName()
Returns:
Returns the name.

setName

public final void setName(String name)
Set the Name.

Parameters:
name - The name to set.

getValue

public Object getValue()
The type depends on the child-class.

Returns:
Returns the value.

setValue

public final void setValue(Object value)
Parameters:
value - The value to set.

isAsCData

public boolean isAsCData()
Returns:
Returns the asCData.

setAsCData

public final void setAsCData(boolean asCData)
Parameters:
asCData - The asCData to set.


Copyright © 2005-2010 The Ajaxtags Team. All Rights Reserved.