@Component(value="simpleXStreamSerializer") 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 |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
SimpleXStreamSerializer()
Default Constructor
|
SimpleXStreamSerializer(AdministrationService adminService) |
SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXStream)
Deprecated.
since 2.7.0, 2.6.2, 2.5.13 use SimpleXStreamSerializer(XStream, AdministrationService)
|
SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXStream,
AdministrationService adminService) |
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
|
void |
initXStream(com.thoughtworks.xstream.XStream newXStream)
Setups permissions and default attributes.
|
String |
serialize(Object o)
Turn the current object into an identifying string that can be retrieved later
|
static void |
setupXStreamSecurity(com.thoughtworks.xstream.XStream newXStream,
AdministrationService adminService)
Setups XStream security using AdministrationService.getSerializerWhitelistTypes()
|
public SimpleXStreamSerializer() throws SerializationException
SerializationException
public SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXStream) throws SerializationException
customXStream
- SerializationException
public SimpleXStreamSerializer(com.thoughtworks.xstream.XStream customXStream, AdministrationService adminService) throws SerializationException
SerializationException
@Autowired public SimpleXStreamSerializer(AdministrationService adminService)
public static void setupXStreamSecurity(com.thoughtworks.xstream.XStream newXStream, AdministrationService adminService)
newXStream
- adminService
- public void initXStream(com.thoughtworks.xstream.XStream newXStream)
newXStream
- 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
Should not deserialize classes that are not whitelisted
Should deserialize whitelisted packages
Should deserialize whitelisted classes and packages
Should deserialize whitelisted hierarchies
Copyright © 2024 OpenMRS Inc.. All rights reserved.