public class AndroidXmlSerializer extends java.lang.Object implements XmlSerializer
XmlSerializer
Constructor and Description |
---|
AndroidXmlSerializer() |
Modifier and Type | Method and Description |
---|---|
<T> T |
fromXml(java.io.Reader xmlReader,
java.lang.Class<T> clazz)
Reads an XML document from a
Reader and converts it into an object of the specified type |
<T> T |
fromXml(java.lang.String xml,
java.lang.Class<T> clazz)
Reads a XML document and converts it into an object of the specified type
|
<T> java.lang.String |
toXml(T object)
Writes a XML document by searching the object for
Field annotations |
<T> void |
toXml(T object,
java.io.Writer writer)
Writes a XML document to a
Writer by searching the object for Field annotations |
public <T> T fromXml(java.lang.String xml, java.lang.Class<T> clazz) throws SerializationException
XmlSerializer
fromXml
in interface XmlSerializer
xml
- The XML documentclazz
- The Class
to convert the document toSerializationException
- Thrown when the data is invalidpublic <T> T fromXml(java.io.Reader xmlReader, java.lang.Class<T> clazz) throws SerializationException
XmlSerializer
Reader
and converts it into an object of the specified typefromXml
in interface XmlSerializer
xmlReader
- The input stream reading the XML documentclazz
- The Class
to convert the document toSerializationException
- Thrown when the data is invalidpublic <T> java.lang.String toXml(T object) throws SerializationException
XmlSerializer
Field
annotationstoXml
in interface XmlSerializer
object
- The object to convert to XMLSerializationException
- Thrown when the object is invalidpublic <T> void toXml(T object, java.io.Writer writer) throws SerializationException
XmlSerializer
Writer
by searching the object for Field
annotationstoXml
in interface XmlSerializer
object
- The object to convert to XMLwriter
- The stream to write the XML document toSerializationException
- Thrown when the object is invalid