org.aludratest.hpalm.infrastructure
Class EntityMarshallingUtils

java.lang.Object
  extended by org.aludratest.hpalm.infrastructure.EntityMarshallingUtils

public class EntityMarshallingUtils
extends Object

A utility class for converting between jaxb annotated objects and xml.


Method Summary
static
<T> T
marshal(Class<T> c, String xml)
           
static
<T> String
unmarshal(Class<T> c, Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

marshal

public static <T> T marshal(Class<T> c,
                            String xml)
                 throws JAXBException
Type Parameters:
T - the type we want to convert our xml into
Parameters:
c - the class of the parameterized type
xml - the instance xml description
Returns:
a deserialization of the xml into an object of type T of class Class
Throws:
JAXBException

unmarshal

public static <T> String unmarshal(Class<T> c,
                                   Object o)
                        throws JAXBException
Type Parameters:
T - the type to serialize
Parameters:
c - the class of the type to serialize
o - the instance containing the data to serialize
Returns:
a string representation of the data.
Throws:
JAXBException


Copyright © 2015 aludratest.org. All rights reserved.