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

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

public class XMLDefaultAction
extends Object
implements Unmarshaller<DefaultAction>, Marshaller<DefaultAction>

Command that marshalls and unmarshalls a DefaultAction into/from an Element.

Author:
sanjin

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

Constructor Detail

XMLDefaultAction

public XMLDefaultAction(Element element)
Creates instance of DefaultAction marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal a DefaultAction.

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

unmarshal

public DefaultAction unmarshal()
                        throws ParsingException
Returns a DefaultAction with its name equal to the name attribute of specified Element and requirement equal to the required attribute. If specified Element does not have a required attribute, then the DefaultAction.DefaultAction(String) constructor will be used, thus setting the requirement to default value.

Specified by:
unmarshal in interface Unmarshaller<DefaultAction>
Returns:
the DefaultAction
Throws:
MissingFieldException - if specified Element does not have a name attribute.
InvalidFieldValueException - if the name attribute is empty or blank string, or the required attribute is not true or false.
ParsingException

marshal

public void marshal(DefaultAction action)
Sets the name attribute and required attribute of specified Element to name and requirement of specified DefaultAction.

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


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