public final class XmlConverter extends Object implements IXmlConverter
| Constructor and Description |
|---|
XmlConverter() |
| Modifier and Type | Method and Description |
|---|---|
ByteArrayOutputStream |
objectToXml(Object obj)
Uses JAXB to parse an object to an output stream.
|
void |
registerTypes(Class... types)
Adds the given classes to the JAXB context so that they can be parsed to
from retrieved XML responses and files.
|
<T> T |
xmlToObject(InputStream xml,
Class<T> toType)
Uses JAXB to parse the supplied XML stream to an instance of the
specified type.
|
public final void registerTypes(Class... types)
registerTypes in interface IXmlConvertertypes - the classes to add to the JAXB contextpublic final <T> T xmlToObject(InputStream xml, Class<T> toType)
xmlToObject in interface IXmlConverterT - the type to parse toxml - the XML streamtoType - the type to parse topublic final ByteArrayOutputStream objectToXml(Object obj)
objectToXml in interface IXmlConverterobj - object to parse to output streamCopyright © 2017. All rights reserved.