public class SimpleXStreamSerializer extends Object implements OpenmrsSerializer
Patient
class
will not be:
<org.openmrs.Patient ...>
<element
...
</org.openmrs.Patient>
but instead will be:
<patient ...>
<element
...
</patient>
Modifier and Type | Field and Description |
---|---|
com.thoughtworks.xstream.XStream |
xstream |
Constructor and Description |
---|
SimpleXStreamSerializer()
Default Constructor
|
SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXstream)
Constructor that takes a custom XStream object
|
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(String serializedObject,
Class<? extends T> clazz)
Deserialize the given string into a full object
|
com.thoughtworks.xstream.XStream |
getXstream()
Expose the xstream object, so that module can config with xstream as need
|
String |
serialize(Object o)
Turn the current object into an identifying string that can be retrieved later
|
public SimpleXStreamSerializer() throws SerializationException
SerializationException
public SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXstream) throws SerializationException
customXstream
- SerializationException
public com.thoughtworks.xstream.XStream getXstream()
public String serialize(Object o) throws SerializationException
OpenmrsSerializer
serialize
in interface OpenmrsSerializer
o
- - the object to serializeSerializationException
Should not serialize proxies
public <T> T deserialize(String serializedObject, Class<? extends T> clazz) throws SerializationException
OpenmrsSerializer
deserialize
in interface OpenmrsSerializer
serializedObject
- - String to deserializeclazz
- - The class to deserialize the Object intoSerializationException
Should not deserialize proxies
Should ignore entities
Copyright © 2021 OpenMRS Inc.. All rights reserved.