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

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.Base
      extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ListMarshaller<T>
          extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ListUnmarshaller<T>
Type Parameters:
T - the type of unmarshaled and marshaled List elements.
All Implemented Interfaces:
Marshaller<java.util.List<T>>, Unmarshaller<java.util.List<T>>

public class ListUnmarshaller<T>
extends ListMarshaller<T>
implements Unmarshaller<java.util.List<T>>

Unmarshals and marshals a List of values from/to an Element .

Author:
sanjin

Nested Class Summary
static class ListUnmarshaller.Builder<T>
          Builder of ListUnmarshaller.
 
Constructor Summary
ListUnmarshaller(org.w3c.dom.Element parent, java.lang.String childName, UnmarshallerBuilder<T> builder)
          Creates instance of List Marshaller that marshals each value from a List into a separate child Element of specified parent Element.
 
Method Summary
 java.util.List<T> unmarshal()
          Unmarshals each child Element using an Unmarshaller created with the UnmarshallerBuilder.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.ListMarshaller
getBuilder, getChildElements, getChildName, getParent, marshal, remove
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.Base
createElement
 
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.util.Marshaller
marshal, remove
 

Constructor Detail

ListUnmarshaller

public ListUnmarshaller(org.w3c.dom.Element parent,
                        java.lang.String childName,
                        UnmarshallerBuilder<T> builder)
Creates instance of List Marshaller that marshals each value from a List into a separate child Element of specified parent Element. Child Elements will have specified local name and will be in Constants.COPAL_NAMESPACE. Specified UnmarshallerBuilder is used to create an Unmarshaller that will unmarshal and/or marshal a value into a child Element.

Parameters:
parent - the parent Element.
childName - the local name of child Elements.
builder - the UnmarshallerBuilder to create Unmarshallers for child Elements.
Throws:
java.lang.NullPointerException - if specified parent Element, name of child Elements or MarshallerBuilder is null.
java.lang.IllegalArgumentException - if specified name of child Elements is an empty or blank string.
Method Detail

unmarshal

public java.util.List<T> unmarshal()
                            throws FailedUnmarshallingException
Unmarshals each child Element using an Unmarshaller created with the UnmarshallerBuilder.

Specified by:
unmarshal in interface Unmarshaller<java.util.List<T>>
Returns:
the List of unmarshaled child Elements.
Throws:
FailedUnmarshallingException - if unmarshalling was unsuccessful.


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