org.jclouds.xml.internal
Class JAXBParser

java.lang.Object
  extended by org.jclouds.xml.internal.JAXBParser
All Implemented Interfaces:
XMLParser

@Singleton
public class JAXBParser
extends Object
implements XMLParser

Parses XML documents using JAXB.

Author:
Ignasi Barrera
See Also:
ParseXMLWithJAXB

Field Summary
 
Fields inherited from interface org.jclouds.xml.XMLParser
DEFAULT_XML_HEADER
 
Constructor Summary
JAXBParser(String prettyPrint)
           
 
Method Summary
<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface XMLParser
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 interface XMLParser
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 interface XMLParser
Throws:
IOException


Copyright © 2009-2013 jclouds. All Rights Reserved.