|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openspml.message.Attribute
A class used to represent an attr
element, found
in several contexts within SPML.
Currently this is the same as a DSML attribute, though it is likely to be extended to provide a richer set of value types. DSML only allows xsd:string, xsd:base64binary and xsd:anyURI values.
The value is allowed to be any object, but until an extension mechanism is in place, values should be limited to Strings or Lists of Strings. Multi-valued attributes are represented with Lists.
Constructor Summary | |
Attribute()
|
|
Attribute(java.lang.String name,
java.lang.Object value)
|
Method Summary | |
static Attribute |
getAttribute(java.util.List attributes,
java.lang.String name)
Utility method to Lookup an attribute by name given a list of attributes. |
static java.util.List |
getAttributes(java.util.Map src)
Convenience method to build a List of Attribute objects given a Map of name/value pairs. |
static java.lang.Object |
getAttributeValue(java.util.List attributes,
java.lang.String name)
Utility method to Lookup an attribute by name given a list of attributes. |
java.lang.String |
getName()
|
java.lang.Object |
getValue()
|
void |
setName(java.lang.String s)
|
void |
setValue(java.lang.Object o)
|
static void |
sort(java.util.List list)
Utility to sort a list of Attribute objects by name. |
static java.util.Map |
toMap(java.util.List attlist)
Given a list of Attribute objects, convert them into a Map of names and values. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Attribute()
public Attribute(java.lang.String name, java.lang.Object value)
Method Detail |
public void setName(java.lang.String s)
public void setValue(java.lang.Object o)
public static java.util.List getAttributes(java.util.Map src)
public java.lang.String getName()
public java.lang.Object getValue()
public static Attribute getAttribute(java.util.List attributes, java.lang.String name)
// It is assumed this won't happen very often and the lists will // be short. If not, then an intermediate class that maintains // a HashMap may be required.
public static java.lang.Object getAttributeValue(java.util.List attributes, java.lang.String name)
The actual value of the attribute is returned.
public static void sort(java.util.List list)
public static java.util.Map toMap(java.util.List attlist)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |