public class XmlConverter extends Object
| Constructor and Description |
|---|
XmlConverter() |
| Modifier and Type | Method and Description |
|---|---|
static ByteArrayOutputStream |
objectToXml(Object obj)
Uses JAXB to parse an object to an output stream.
|
static 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.
|
static <T> T |
xmlToObject(InputStream xml,
Class<T> toType)
Uses JAXB to parse the supplied XML stream to an instance of the
specified type.
|
public static final void registerTypes(Class... types)
types - the classes to add to the JAXB contextpublic static final <T> T xmlToObject(InputStream xml, Class<T> toType)
T - the type to parse toxml - the XML streamtoType - the type to parse topublic static final ByteArrayOutputStream objectToXml(Object obj)
obj - object to parse to output streamCopyright © 2016. All rights reserved.