public class XmlSerializer<T> extends Object
Modifier | Constructor and Description |
---|---|
protected |
XmlSerializer(Class clazz,
String schemaName,
String schemaVersion)
Creates a serializer which will be used to handle serializations
to and from the given top level class, using the given schema.
|
Modifier and Type | Method and Description |
---|---|
T |
deserialize(InputStream stream)
De-serializes XML from an InputStream into an object structure.
|
T |
deserialize(String xml)
De-serializes XML into an object structure.
|
String |
serialize(T obj)
Serializes the data stored within a java bean to XML.
|
protected XmlSerializer(Class clazz, String schemaName, String schemaVersion)
clazz
- class which should be annotated as an XmlRootElementschemaName
- name of the schema to use for validationschemaVersion
- version of the schema expectedpublic String serialize(T obj)
obj
- to serializepublic T deserialize(String xml)
xml
- to de-serializepublic T deserialize(InputStream stream)
stream
- containing XML to de-serializeCopyright © 2009–2014 DuraSpace. All rights reserved.