at.ac.tuwien.infosys.sm4all.copal.api.xml
Class ElementUnmarshaller<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.ElementMarshaller<T>
          extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.ElementUnmarshaller<T>
Type Parameters:
T - the type of unmarshaled and marshaled value.
All Implemented Interfaces:
Marshaller<T>, Unmarshaller<T>

public class ElementUnmarshaller<T>
extends ElementMarshaller<T>
implements Unmarshaller<T>

Unmarshals and marshals a child Element of a parent Element .

Author:
sanjin

Nested Class Summary
static class ElementUnmarshaller.Builder<T>
          Builder of ElementUnmarshaller.
 
Constructor Summary
ElementUnmarshaller(org.w3c.dom.Element parent, java.lang.String childName, UnmarshallerBuilder<T> builder, RemoveStrategy strategy)
          Creates instance of child Element Marshaller of specified parent Element.
 
Method Summary
 T unmarshal()
          Unmarshals a child Element using an Unmarshaller created with the UnmarshallerBuilder.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.xml.ElementMarshaller
getBuilder, getChildElement, getChildName, getParent, getStrategy, 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

ElementUnmarshaller

public ElementUnmarshaller(org.w3c.dom.Element parent,
                           java.lang.String childName,
                           UnmarshallerBuilder<T> builder,
                           RemoveStrategy strategy)
Creates instance of child Element Marshaller of specified parent Element. Child Element 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 the child Element and specified RemoveStrategy is used to remove marshaled value.

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

unmarshal

public T unmarshal()
            throws FailedUnmarshallingException
Unmarshals a child Element using an Unmarshaller created with the UnmarshallerBuilder.

Specified by:
unmarshal in interface Unmarshaller<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.