Package com.almis.awe.model.component
Class XStreamSerializer
java.lang.Object
com.almis.awe.model.component.XStreamSerializer
- Author:
- pgarcia
-
Constructor Summary
ConstructorDescriptionXStreamSerializer
(org.springframework.oxm.xstream.XStreamMarshaller xStreamMarshaller) Autowired constructor -
Method Summary
Modifier and TypeMethodDescription<T> T
getObjectFromTemplate
(Class<T> wrapperClass, String template) Deserialize an object from a string template (Xml to InputStream (Object))<T> T
getObjectFromXml
(Class<T> wrapperClass, InputStream inputStream) Deserialize an object from an XML InputStream (Xml to InputStream (Object))<T> T
getObjectFromXml
(Class<T> wrapperClass, Reader reader) Deserialize an object from an XML reader (Xml to Reader (Object))<T> String
writeStringFromObject
(Object object) Serialize an object to the given Writer as pretty-printed XML (Object to Xml)<T> void
writeXmlFromObject
(Class<T> wrapperClass, Object object, Writer writer) Serialize an object to the given Writer as pretty-printed XML (Object to Xml)<T> void
writeXmlFromObject
(Object object, OutputStream outputStream) Serialize an object to the given OutputStream as pretty-printed XML (Object to Xml)
-
Constructor Details
-
XStreamSerializer
public XStreamSerializer(org.springframework.oxm.xstream.XStreamMarshaller xStreamMarshaller) Autowired constructor- Parameters:
xStreamMarshaller
- Marshaller
-
-
Method Details
-
writeXmlFromObject
Serialize an object to the given OutputStream as pretty-printed XML (Object to Xml)- Parameters:
object
- Object to serializeoutputStream
- OutputStream to set
-
writeXmlFromObject
Serialize an object to the given Writer as pretty-printed XML (Object to Xml)- Parameters:
wrapperClass
- Class with XStream annotationsobject
- Object to serializewriter
- Writer to set
-
writeStringFromObject
Serialize an object to the given Writer as pretty-printed XML (Object to Xml)- Parameters:
object
- Object to serialize
-
getObjectFromXml
Deserialize an object from an XML reader (Xml to Reader (Object))- Type Parameters:
T
- Object deserialize type- Parameters:
wrapperClass
- Class with XStream annotationsreader
- Reader for deserialize- Returns:
- Object deserialize
-
getObjectFromXml
Deserialize an object from an XML InputStream (Xml to InputStream (Object))- Type Parameters:
T
- Object deserialize type- Parameters:
wrapperClass
- Class with XStream annotationsinputStream
- InputStream for deserialize- Returns:
- Object deserialize
-
getObjectFromTemplate
Deserialize an object from a string template (Xml to InputStream (Object))- Type Parameters:
T
- Object deserialize type- Parameters:
wrapperClass
- Class with XStream annotationstemplate
- Template for deserialize- Returns:
- Object deserialize
-