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

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

public class XMLAttribute
extends Object
implements Unmarshaller<Attribute>, Marshaller<Attribute>

Command that marshalls and unmarshalls an Attribute into/from an Element.

Author:
sanjin

Constructor Summary
XMLAttribute(Element element)
          Creates instance of Attribute marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal an Attribute.
 
Method Summary
 void marshal(Attribute attribute)
          Sets the name attribute and value attribute of specified Element to name and value of specified Attribute.
 Attribute unmarshal()
          Returns an Attribute with its name equal to the name attribute of specified Element and value equal to the value attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLAttribute

public XMLAttribute(Element element)
Creates instance of Attribute marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal an Attribute.

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

unmarshal

public Attribute unmarshal()
                    throws ParsingException
Returns an Attribute with its name equal to the name attribute of specified Element and value equal to the value attribute.

Specified by:
unmarshal in interface Unmarshaller<Attribute>
Returns:
the Attribute
Throws:
MissingFieldException - if specified Element does not have name or value attribute.
InvalidFieldValueException - if either the name or value attribute is empty or blank string.
ParsingException

marshal

public void marshal(Attribute attribute)
Sets the name attribute and value attribute of specified Element to name and value of specified Attribute.

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


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