wt.org
Class DefaultAttributeHolder

java.lang.Object
  extended bywt.org.DefaultAttributeHolder
All Implemented Interfaces:
AttributeHolder, Externalizable, Serializable

public class DefaultAttributeHolder
extends Object
implements AttributeHolder, Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private  Hashtable attributes
           
private static HashMap baseKeys
           
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private  Hashtable keys
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
DefaultAttributeHolder()
          

Supported API: false
 
Method Summary
private  void _addKey(String normalized, String unnormalized)
           
private  String _normalizeName(String name)
           
 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 readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(DefaultAttributeHolder thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 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.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

attributes

private Hashtable attributes

keys

private Hashtable keys

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

baseKeys

private static final HashMap baseKeys
Constructor Detail

DefaultAttributeHolder

public DefaultAttributeHolder()


Supported API: false

Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(DefaultAttributeHolder thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getValues

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

Supported API: false

Specified by:
getValues in interface AttributeHolder
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

Specified by:
getSingleValue in interface AttributeHolder
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

Specified by:
getAttrNames in interface AttributeHolder
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

Specified by:
addValue in interface AttributeHolder
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

Specified by:
setValue in interface AttributeHolder
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

Specified by:
replaceValue in interface AttributeHolder
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

Specified by:
removeValue in interface AttributeHolder
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

Specified by:
removeAttribute in interface AttributeHolder
Parameters:
attr_name -
Throws:
WTException

toString

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

Supported API: false

Specified by:
toString in interface AttributeHolder
Returns:
String

_normalizeName

private String _normalizeName(String name)

_addKey

private void _addKey(String normalized,
                     String unnormalized)