at.ac.tuwien.infosys.sm4all.copal.api.xml
Class ArrayMarshaller<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>
Type Parameters:
T - the type of array elements.
All Implemented Interfaces:
Marshaller<T[]>
Direct Known Subclasses:
ArrayElement, XMLContextListeners, XMLContextProcessors, XMLContextPublishers, XMLContextQueries

public abstract class ArrayMarshaller<T>
extends ElementUtil
implements Marshaller<T[]>

Command that marshals an array.

Author:
sanjin

Constructor Summary
ArrayMarshaller(Element parentElement, String namespaceURI, String prefix, String localName)
          Creates an instance of array marshaller which uses specified parent Element to marshal array elements.
 
Method Summary
 void marshal(T[] array)
          Removes all array Elements from specified parent Element and appends marshalled array Elements from specified array.
protected abstract  void marshal(T object, Element element)
          Marshal specified object into specified Element.
 
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

ArrayMarshaller

public ArrayMarshaller(Element parentElement,
                       String namespaceURI,
                       String prefix,
                       String localName)
Creates an instance of array marshaller which uses specified parent Element to marshal 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

marshal

protected abstract void marshal(T object,
                                Element element)
Marshal specified object into specified Element.

Parameters:
object - the object to marshal.
element - the Element into which specified object should be marshalled.

marshal

public void marshal(T[] array)
Removes all array Elements from specified parent Element and appends marshalled array Elements from specified array.

Specified by:
marshal in interface Marshaller<T[]>
Parameters:
array - the array.
Throws:
NullPointerException - if specified array is null.


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