Package org.jclouds.xml.internal
Class JAXBParser
- java.lang.Object
-
- org.jclouds.xml.internal.JAXBParser
-
-
Field Summary
-
Fields inherited from interface org.jclouds.xml.XMLParser
DEFAULT_XML_HEADER
-
-
Constructor Summary
Constructors Constructor Description JAXBParser(String prettyPrint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
fromXML(String xml, Class<T> type)
Deserialize the object from xml.String
toXML(Object src)
Serialize the object into xml.<T> String
toXML(Object src, Class<T> type)
Serialize the object into xml, as the declared type.
-
-
-
Constructor Detail
-
JAXBParser
@Inject public JAXBParser(String prettyPrint)
-
-
Method Detail
-
toXML
public String toXML(Object src) throws IOException
Description copied from interface:XMLParser
Serialize the object into xml.- Specified by:
toXML
in interfaceXMLParser
- Throws:
IOException
-
toXML
public <T> String toXML(Object src, Class<T> type) throws IOException
Description copied from interface:XMLParser
Serialize the object into xml, as the declared type.- Specified by:
toXML
in interfaceXMLParser
- Throws:
IOException
-
fromXML
public <T> T fromXML(String xml, Class<T> type) throws IOException
Description copied from interface:XMLParser
Deserialize the object from xml.- Specified by:
fromXML
in interfaceXMLParser
- Throws:
IOException
-
-