|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.authorize.util.XmlUtility
public final class XmlUtility
Helper methods for serializing and de-serializing to XML using JAXB
| Method Summary | ||
|---|---|---|
static
|
create(String xml,
Class<T> classType)
Helper method to de-serialize XML to an object. |
|
static String |
descapeStringForXml(String valueToDeserialize)
Helper method to decode a string from XML string Returns the same string if null or empty |
|
static String |
escapeStringForXml(String valueToSerialize)
Helper method to encode a string to XML Returns the same string if null or empty |
|
static String |
getRootElementXml(String xmlString)
Removes the XML prologue |
|
static
|
getRootElementXml(T entity)
Removes the XML prologue |
|
static
|
getXml(T entity)
Helper method to serialize an object to XML. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T extends Serializable> String getXml(T entity)
throws IOException,
javax.xml.bind.JAXBException
T - class that implements Serializableentity - Object to serialize
IOException - if errors during serialization
javax.xml.bind.JAXBException - if errors during serialization
public static <T extends Serializable> T create(String xml,
Class<T> classType)
throws javax.xml.bind.JAXBException
T - class that implements Serializablexml - object serialized into valid XMLclassType - Class Type of the object to be de-serialized into
javax.xml.bind.JAXBException - if errors during de-serializationpublic static String escapeStringForXml(String valueToSerialize)
valueToSerialize - string value to encode into xml
public static String descapeStringForXml(String valueToDeserialize)
valueToDeserialize - string value to decode from xml
public static <T extends Serializable> String getRootElementXml(T entity)
entity - object to remove prologue
public static String getRootElementXml(String xmlString)
xmlString - string to remove prologue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||