at.ac.tuwien.infosys.sm4all.copal.api.event.xml.processor
Class XMLProcessorAction

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

public class XMLProcessorAction
extends Object
implements Unmarshaller<ProcessorAction>, Marshaller<ProcessorAction>

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

Author:
sanjin

Constructor Summary
XMLProcessorAction(Element element)
          Creates instance of ProcessorAction marshaller and unmarshaller which uses specified Element to marshal and/or unmarshal a ProcessorAction.
 
Method Summary
 void marshal(ProcessorAction action)
          Sets the name attribute, inputEvent, and outputEvent attribute of specified Element to name, event type and result type of specified ProcessorAction.
 ProcessorAction unmarshal()
          Returns a ProcessorAction with its name equal to the name attribute of specified Element, event type equal to the inputEvent attribute, and, if present, result type equal to the outputEvent attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLProcessorAction

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

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

unmarshal

public ProcessorAction unmarshal()
                          throws ParsingException
Returns a ProcessorAction with its name equal to the name attribute of specified Element, event type equal to the inputEvent attribute, and, if present, result type equal to the outputEvent attribute.

Specified by:
unmarshal in interface Unmarshaller<ProcessorAction>
Returns:
the unmarshalled ProcessorAction
Throws:
MissingFieldException - if specified Element does not have a name or an inputEvent attribute.
InvalidFieldValueException - if the name, inputEvent or outputEvent attribute is empty or blank string.
ParsingException

marshal

public void marshal(ProcessorAction action)
Sets the name attribute, inputEvent, and outputEvent attribute of specified Element to name, event type and result type of specified ProcessorAction. If specified ProcessorAction does not have a result type the outputEvent attribute is removed from specified Element.

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


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