|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ws4d.java.types.AttributableSupport
public class AttributableSupport
A standard implementation of the Attributable
interface.
Constructor Summary | |
---|---|
AttributableSupport()
Default constructor. |
|
AttributableSupport(HashMap attributes)
Creates a new instance with the given attributes . |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
CustomAttributeValue |
getAttribute(QName name)
Returns the value of the attribute with the given name or
null , if this attribute is not available (or if its value is
actually explicitly set to null ). |
HashMap |
getAttributes()
Returns all attributes explicitly set for this Attributable
instance. |
boolean |
hasAttributes()
Returns true only if this instance has at least one
attribute set. |
int |
hashCode()
|
void |
serializeAttributes(org.xmlpull.v1.XmlSerializer serializer)
Serializes the attributes stored within this instance, if any. |
void |
setAttribute(QName name,
CustomAttributeValue value)
Sets the value for the attribute with the specified
name . |
void |
setAttribute(QName name,
java.lang.String value)
Sets the value for the attribute with the specified
name . |
void |
setAttributes(HashMap attributes)
Sets all attributes at once to those contained within argument attributes . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AttributableSupport()
public AttributableSupport(HashMap attributes)
attributes
.
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public CustomAttributeValue getAttribute(QName name)
Attributable
name
or
null
, if this attribute is not available (or if its value is
actually explicitly set to null
).
getAttribute
in interface Attributable
name
- the name of the attribute of which to query the value
null
public void setAttribute(QName name, CustomAttributeValue value)
Attributable
value
for the attribute with the specified
name
. Throws a
java.lang.IllegalArgumentException
in case name
is null
.
setAttribute
in interface Attributable
name
- the name of the attribute to set, must not be
null
value
- the value to set the named attribute to (may be
null
public void setAttribute(QName name, java.lang.String value)
Attributable
value
for the attribute with the specified
name
. The value will be represented as plain String. It will
be wrapped within a new instance of StringAttributeValue
. This
method throws a java.lang.IllegalArgumentException
in case
name
is null
.
This is a shorthand for
setAttribute(name, new StringAttributeValue(value))
.
setAttribute
in interface Attributable
name
- the name of the attribute to set, must not be
null
value
- the value to set the named attribute to (may be
null
public HashMap getAttributes()
Attributable
Attributable
instance. Note that depending on the actual implementation the returned
reference may point at the 'life map', i .e. the actual storage for the
attributes. Thus, modifications to that map should be performed with care
and keeping this in mind.
getAttributes
in interface Attributable
public void setAttributes(HashMap attributes)
Attributable
attributes
. Note that depending on the actual implementation
it is possible that the map attributes
points at may be used
for the actual internal storage of the attributes (i.e. without copying
it). That is why, after passing it to this method, modifications to this
map should be made with care. This method throws a
java.lang.IllegalArgumentException
in cases where
attributes
is null
.
setAttributes
in interface Attributable
attributes
- the new attributes to setpublic boolean hasAttributes()
Attributable
true
only if this instance has at least one
attribute set. Returns false
in any other case.
hasAttributes
in interface Attributable
true
only if there is at least one attribute set
within this instancepublic void serializeAttributes(org.xmlpull.v1.XmlSerializer serializer) throws java.io.IOException
Attributable
serializeAttributes
in interface Attributable
serializer
- the serializer to which to send output
java.io.IOException
- in case writing to serializer
fails for
any reason
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |