com.waveset.object
Class WSAttributes

java.lang.Object
  extended bycom.waveset.object.WSAttributes

public class WSAttributes
extends java.lang.Object


Field Summary
static java.lang.String code_id
           
 
Constructor Summary
WSAttributes()
           
WSAttributes(org.w3c.dom.Element e)
          Assumes that the element passed in contains "Attribute" children elements that can be parsed and turned into WSAttribute instances.
WSAttributes(java.util.Map map)
          Build an attributes object by converting a Map of values.
WSAttributes(java.lang.String xml)
          Assumes that the string passed in contains "Attribute" children elements that can be parsed and turned into WSAttribute instances: ...
WSAttributes(WSAttribute attr)
           
WSAttributes(WSAttribute[] attrs)
           
 
Method Summary
 void fromMap(java.util.Map map)
          Convert a Map into a WSAttributes object.
 WSAttribute get(Attribute attribute)
           
 WSAttribute get(java.lang.String name)
           
 WSAttribute[] getAll()
           
 java.lang.String[] getIDs()
           
 java.lang.String[] getNames()
           
 java.lang.Object getValue(java.lang.String name)
           
 java.lang.String getValueAsString(Attribute attr)
           
 java.lang.String getValueAsString(java.lang.String attrName)
           
static java.lang.String getValueAsString(WSAttributes attrs, Attribute attr)
           
static java.lang.String getValueAsString(WSAttributes attrs, java.lang.String attrName)
           
static void main(java.lang.String[] args)
           
 void parseXml(java.lang.String xml)
          Assumes that the string passed in contains an Attributes element with "Attribute" children elements that can be parsed and turned into WSAttribute instances: ...
 WSAttribute put(WSAttribute attr)
           
 void putAll(WSAttributes attrs)
           
 WSAttribute remove(Attribute attr)
           
 WSAttribute remove(java.lang.String name)
           
 int size()
           
 java.util.Map toMap()
          Convert a WSAttributes object into a standard Map.
 void toMap(java.util.Map map)
          Convert the contents of a WSAttributes object into a Map.
 java.lang.String toString()
           
 java.lang.String toXml()
          Returns the string buffer built by toXml(StringBuffer) as a String.
 void toXml(java.lang.StringBuffer buf)
          Calls toXml(StringBuffer) on each WSAttribute.
 void toXml(java.lang.StringBuffer buf, int indent, java.lang.String wrapper)
          Calls toXml(StringBuffer) on each WSAttribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

WSAttributes

public WSAttributes()

WSAttributes

public WSAttributes(WSAttribute attr)

WSAttributes

public WSAttributes(WSAttribute[] attrs)

WSAttributes

public WSAttributes(java.lang.String xml)
             throws WavesetException
Assumes that the string passed in contains "Attribute" children elements that can be parsed and turned into WSAttribute instances: ...


WSAttributes

public WSAttributes(org.w3c.dom.Element e)
             throws WavesetException
Assumes that the element passed in contains "Attribute" children elements that can be parsed and turned into WSAttribute instances.


WSAttributes

public WSAttributes(java.util.Map map)
Build an attributes object by converting a Map of values.

Method Detail

get

public WSAttribute get(Attribute attribute)

get

public WSAttribute get(java.lang.String name)

getValue

public java.lang.Object getValue(java.lang.String name)

getIDs

public java.lang.String[] getIDs()

getNames

public java.lang.String[] getNames()

getAll

public WSAttribute[] getAll()

put

public WSAttribute put(WSAttribute attr)

putAll

public void putAll(WSAttributes attrs)

remove

public WSAttribute remove(Attribute attr)

remove

public WSAttribute remove(java.lang.String name)

toString

public java.lang.String toString()

size

public int size()

getValueAsString

public static java.lang.String getValueAsString(WSAttributes attrs,
                                                Attribute attr)
Returns:
the value of the specified attribute (if any) within the specified collection of attributes.

getValueAsString

public static java.lang.String getValueAsString(WSAttributes attrs,
                                                java.lang.String attrName)
Returns:
the value of the specified attribute (if any) within the specified collection of attributes.

getValueAsString

public java.lang.String getValueAsString(Attribute attr)
Returns:
the value of the specified attribute (if any).

getValueAsString

public java.lang.String getValueAsString(java.lang.String attrName)
Returns:
the value of the specified attribute (if any).

toMap

public java.util.Map toMap()
Convert a WSAttributes object into a standard Map. Multi-valued attributes are converted to standard Lists.


toMap

public void toMap(java.util.Map map)
Convert the contents of a WSAttributes object into a Map.


fromMap

public void fromMap(java.util.Map map)
Convert a Map into a WSAttributes object. List values have to be converted into AttributeValues objects.


parseXml

public void parseXml(java.lang.String xml)
              throws WavesetException
Assumes that the string passed in contains an Attributes element with "Attribute" children elements that can be parsed and turned into WSAttribute instances: ... Note: If subclasses of WSAttribute were used instead of WSAttribute to generate the XMLbeing parsed, then this method may behave unexpectedly in that it will create WSAttribute instances and not instances of the WSAttribute subclass.

Throws:
WavesetException

toXml

public java.lang.String toXml()
Returns the string buffer built by toXml(StringBuffer) as a String.


toXml

public void toXml(java.lang.StringBuffer buf,
                  int indent,
                  java.lang.String wrapper)
Calls toXml(StringBuffer) on each WSAttribute.


toXml

public void toXml(java.lang.StringBuffer buf)
Calls toXml(StringBuffer) on each WSAttribute.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception