wt.org
Interface AttributeHolder

All Known Implementing Classes:
DefaultAttributeHolder, DirectoryAttributeHolder, LDAPAttributeHolder, StandardAttributeHolder

public interface AttributeHolder

Interface specifying a generic attribute holding behavior. The important characteristics are that attributes are identified by their names (String type) and can hold many values (including zero), each one being an arbitrary object.

Supported API: false

Extendable: false


Method Summary
 void addValue(String attr_name, Object value)
          Adds value to attribute.
 Enumeration getAttrNames()
          Returns all names of the attributes held by the object.
 Object getSingleValue(String attr_name)
          Return one value associated with the attribute name.
 Enumeration getValues(String attr_name)
          Returns the values associated with a given attribute name.
 void removeAttribute(String attr_name)
          Removes an attribute from the object (with all its values).
 void removeValue(String attr_name, Object value)
          Removes a specific value from the attribute.
 void replaceValue(String attr_name, Object value)
          Replaces object for all the current values of the attribute.
 void setValue(String attr_name, Object value)
          Replaces object for all the current values of the attribute.
 String toString()
          Creates string representation of the attribute holder.
 

Method Detail

getValues

public Enumeration getValues(String attr_name)
                      throws WTException
Returns the values associated with a given attribute name.

Supported API: false

Parameters:
attr_name -
Returns:
Enumeration
Throws:
WTException

getSingleValue

public Object getSingleValue(String attr_name)
                      throws WTException
Return one value associated with the attribute name. Handy method if one knows that the attribute holds just a single value. Returns null if no value is associated with the attribute.

Supported API: false

Parameters:
attr_name -
Returns:
Object
Throws:
WTException

getAttrNames

public Enumeration getAttrNames()
                         throws WTException
Returns all names of the attributes held by the object.

Supported API: false

Returns:
Enumeration
Throws:
WTException

addValue

public void addValue(String attr_name,
                     Object value)
              throws WTException
Adds value to attribute. Creates attribute if this is the first time.

Supported API: false

Parameters:
attr_name -
value -
Throws:
WTException

setValue

public void setValue(String attr_name,
                     Object value)
              throws WTException
Replaces object for all the current values of the attribute.

Supported API: false

Parameters:
attr_name -
value -
Throws:
WTException

replaceValue

public void replaceValue(String attr_name,
                         Object value)
                  throws WTException
Replaces object for all the current values of the attribute.

Supported API: false

Parameters:
attr_name -
value -
Throws:
WTException

removeValue

public void removeValue(String attr_name,
                        Object value)
                 throws WTException
Removes a specific value from the attribute. If the value is the last one the attribute is removed as well.

Supported API: false

Parameters:
attr_name -
value -
Throws:
WTException

removeAttribute

public void removeAttribute(String attr_name)
                     throws WTException
Removes an attribute from the object (with all its values).

Supported API: false

Parameters:
attr_name -
Throws:
WTException

toString

public String toString()
Creates string representation of the attribute holder.

Supported API: false

Returns:
String