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

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

public class AttributeUnmarshaller
extends Object
implements Unmarshaller<Attribute>

Unmarshalls and marshalls an Attribute from/into an Element.

Author:
sanjin

Nested Class Summary
static class AttributeUnmarshaller.Builder
          Builder of AttributeUnmarshaller.
 
Field Summary
static String ATTRIBUTE_ELEMENT
          The local name of child Elements used in the ListUnmarshaller.Builder that is returned by the getListBuilder().
static String NAME_ATTRIBUTE
          The name of attribute that holds marshalled name.
static String VALUE_ATTRIBUTE
          The name of attribute that holds marshalled value.
 
Constructor Summary
AttributeUnmarshaller(Element element)
          Creates instance of Attribute Unmarshaller which uses specified Element for unmarshalling and/or marshalling.
 
Method Summary
 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)
          Marshalls specified Attribute into the Element.
 void remove()
          Removes any marshalled Attribute from the Element.
 Attribute unmarshal()
          Unmarshalls an Attribute from the Element.
 String unmarshalName()
          Unmarshalls name of Attribute from the Element.
 String unmarshalValue()
          Unmarshalls 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 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 String NAME_ATTRIBUTE
The name of attribute that holds marshalled name.

See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final String VALUE_ATTRIBUTE
The name of attribute that holds marshalled value.

See Also:
Constant Field Values
Constructor Detail

AttributeUnmarshaller

public AttributeUnmarshaller(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:
NullPointerException - if specified Element is null.
Method Detail

getElement

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

Returns:
the Element used for unmarshalling and marshalling.

unmarshal

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

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

unmarshalName

public String unmarshalName()
                     throws FailedUnmarshallingException
Unmarshalls name of Attribute from the Element.

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

unmarshalValue

public String unmarshalValue()
                      throws FailedUnmarshallingException
Unmarshalls value of Attribute from the Element.

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

marshal

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

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

remove

public void remove()
Removes any marshalled 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 and the strategy is set to Append.

Returns:
the ListUnmarshaller.Builder for Attributes.


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