at.ac.tuwien.infosys.sm4all.copal.api.event.xml
Class AttributeUnmarshaller

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.xml.AttributeUnmarshaller
All Implemented Interfaces:
Marshaller<Attribute>, Unmarshaller<Attribute>

public class AttributeUnmarshaller
extends java.lang.Object
implements Unmarshaller<Attribute>

Unmarshals and marshals an Attribute from/into an Element.

Author:
sanjin

Nested Class Summary
static class AttributeUnmarshaller.Builder
          Builder of AttributeUnmarshaller.
 
Field Summary
static java.lang.String ATTRIBUTE_ELEMENT
          The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().
static java.lang.String NAME_ATTRIBUTE
          The name of attribute that holds marshaled name.
static java.lang.String VALUE_ATTRIBUTE
          The name of attribute that holds marshaled value.
 
Constructor Summary
AttributeUnmarshaller(org.w3c.dom.Element element)
          Creates instance of Attribute Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
 
Method Summary
 org.w3c.dom.Element getElement()
          Returns the Element used for unmarshalling and marshalling.
static ListUnmarshaller.Builder<Attribute> getListBuilder()
          Creates instance of ListUnmarshaller.Builder for Attributes.
 void marshal(Attribute attribute)
          Marshals specified Attribute into the Element.
 void remove()
          Removes any marshaled Attribute from the Element.
 Attribute unmarshal()
          Unmarshals an Attribute from the Element.
 java.lang.String unmarshalName()
          Unmarshals name of Attribute from the Element.
 java.lang.String unmarshalValue()
          Unmarshals value of Attribute from the Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_ELEMENT

public static final java.lang.String ATTRIBUTE_ELEMENT
The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().

See Also:
Constant Field Values

NAME_ATTRIBUTE

public static final java.lang.String NAME_ATTRIBUTE
The name of attribute that holds marshaled name.

See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final java.lang.String VALUE_ATTRIBUTE
The name of attribute that holds marshaled value.

See Also:
Constant Field Values
Constructor Detail

AttributeUnmarshaller

public AttributeUnmarshaller(org.w3c.dom.Element element)
Creates instance of Attribute Unmarshaller which uses specified Element for unmarshalling and/or marshalling.

Parameters:
element - the Element used for unmarshalling and marshalling.
Throws:
java.lang.NullPointerException - if specified Element is null.
Method Detail

getElement

public org.w3c.dom.Element getElement()
Returns the Element used for unmarshalling and marshalling.

Returns:
the Element used for unmarshalling and marshalling.

unmarshal

public Attribute unmarshal()
                    throws FailedUnmarshallingException
Unmarshals an Attribute from the Element.

Specified by:
unmarshal in interface Unmarshaller<Attribute>
Returns:
the unmarshaled Attribute.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalName

public java.lang.String unmarshalName()
                               throws FailedUnmarshallingException
Unmarshals name of Attribute from the Element.

Returns:
the name of marshaled Attribute.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

unmarshalValue

public java.lang.String unmarshalValue()
                                throws FailedUnmarshallingException
Unmarshals value of Attribute from the Element.

Returns:
the value of marshaled Attribute.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.

marshal

public void marshal(Attribute attribute)
Marshals specified Attribute into the Element.

Specified by:
marshal in interface Marshaller<Attribute>
Parameters:
attribute - the Attribute.
Throws:
java.lang.NullPointerException - if specified Attribute is null.

remove

public void remove()
Removes any marshaled Attribute from the Element.

Specified by:
remove in interface Marshaller<Attribute>

getListBuilder

public static ListUnmarshaller.Builder<Attribute> getListBuilder()
Creates instance of ListUnmarshaller.Builder for Attributes. The returned ListUnmarshaller.Builder does not have the parent Element set and caller should set it before building the ListUnmarshaller for Attributes. The name for child Elements is set to ATTRIBUTE_ELEMENT.

Returns:
the ListUnmarshaller.Builder for Attributes.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.