at.ac.tuwien.infosys.sm4all.copal.api.xml
Class ArrayElement<T>

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ElementUtil
      extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ArrayMarshaller<T>
          extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ArrayElement<T>
Type Parameters:
T - the type of array elements.
All Implemented Interfaces:
Marshaller<T[]>, Unmarshaller<T[]>
Direct Known Subclasses:
Events, ProcessorActionOutput, XMLAttributes, XMLDefaultActions, XMLProcessorActions

public abstract class ArrayElement<T>
extends ArrayMarshaller<T>
implements Unmarshaller<T[]>

Command that marshals and unmarshalls an array.

Author:
sanjin

Constructor Summary
ArrayElement(Element parentElement, String namespaceURI, String prefix, String localName)
          Creates an instance of array marshaller and unmarshaller which uses specified parent Element to marshal and/or unmarshal array elements.
 
Method Summary
protected abstract  T unmarshal(Element element)
          Unmarshal singled value from specified Element.
 List<T> unmarshalList()
          Returns the unmarshalled child Elements of specified parent Element.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.ArrayMarshaller
marshal, marshal
 
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
 
Methods inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.xml.Unmarshaller
unmarshal
 

Constructor Detail

ArrayElement

public ArrayElement(Element parentElement,
                    String namespaceURI,
                    String prefix,
                    String localName)
Creates an instance of array marshaller and unmarshaller which uses specified parent Element to marshal and/or unmarshal array elements.

Parameters:
parentElement - the Element that holds all marshalled Elements.
namespaceURI - the namespace URI of marshalled Elements.
prefix - the prefix of marshalled Elements.
localName - the local name of marshalled Elements.
Throws:
NullPointerException - if specified parent Element is null.
Method Detail

unmarshal

protected abstract T unmarshal(Element element)
                        throws ContextException
Unmarshal singled value from specified Element.

Parameters:
element - the Element.
Returns:
single value.
Throws:
ContextException - if unmarshalling fails.

unmarshalList

public List<T> unmarshalList()
                      throws ContextException
Returns the unmarshalled child Elements of specified parent Element.

Returns:
the unmarshalled child Elements.
Throws:
ContextException - if unmarshalling of any child Element fails.


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