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

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

public class XMLProcessorAction
extends ElementUtil
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 of specified Element to name of specified ProcessorAction, the event attribute of the Input child Element to input of specified ProcessorAction, and name attributes of Output's Event Elements to output of specified ProcessorAction.
 ProcessorAction unmarshal()
          Returns a ProcessorAction with its name equal to the name attribute of specified Element, input equal to the event attribute of the Input child Element, and, if present, output equal to the name attributes of the Output's Event Elements.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.ElementUtil
getChildElement, getChildElement
 
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 ContextException
Returns a ProcessorAction with its name equal to the name attribute of specified Element, input equal to the event attribute of the Input child Element, and, if present, output equal to the name attributes of the Output's Event Elements.

Specified by:
unmarshal in interface Unmarshaller<ProcessorAction>
Returns:
the unmarshalled ProcessorAction.
Throws:
ContextException - if unmarshalling fails.

marshal

public void marshal(ProcessorAction action)
Sets the name attribute of specified Element to name of specified ProcessorAction, the event attribute of the Input child Element to input of specified ProcessorAction, and name attributes of Output's Event Elements to output of specified ProcessorAction. If specified ProcessorAction does not have an output the Output child Element 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.