public class SerializationHelper extends Object
| Constructor and Description |
|---|
SerializationHelper() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserializeXml(String requestString,
Class<T> clazz)
Deserialize a XML response.
|
static String |
formatXml(String requestBody)
Pretty print / format the provided XML string.
|
static String |
serializeToXml(Object object)
Serialize a request as XML.
|
public static String formatXml(String requestBody)
requestBody - string to pretty print as XMLpublic static String serializeToXml(Object object) throws JAXBException
object - object to marshalJAXBException - if the object could not be marshalled in to XMLpublic static <T> T deserializeXml(String requestString, Class<T> clazz) throws JAXBException
T - type of the classrequestString - XML stringclazz - class to use as deserialization targetJAXBException - if the deserialization failedCopyright © 2017. All rights reserved.