@Transactional public class SerializationServiceImpl extends BaseOpenmrsService implements SerializationService
Modifier and Type | Field and Description |
---|---|
org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
SerializationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(java.lang.String serializedObject,
java.lang.Class<? extends T> objectClass,
java.lang.Class<? extends OpenmrsSerializer> serializerClass)
Deserialize the given string into a full object using the given
OpenmrsSerializer
class |
OpenmrsSerializer |
getDefaultSerializer()
Returns the default serializer configured for the system.
|
OpenmrsSerializer |
getSerializer(java.lang.Class<? extends OpenmrsSerializer> serializationClass)
Returns the serializer that matches the passed class, or null if no such serializer exists.
|
java.util.List<? extends OpenmrsSerializer> |
getSerializers()
Gets the list of OpenmrsSerializers that have been registered with this service.
|
java.lang.String |
serialize(java.lang.Object o,
java.lang.Class<? extends OpenmrsSerializer> clazz)
Serialize the passed object into an identifying string that can be retrieved later using the
passed
OpenmrsSerializer class |
void |
setSerializers(java.util.List<? extends OpenmrsSerializer> serializers) |
onShutdown, onStartup
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onShutdown, onStartup
public OpenmrsSerializer getSerializer(java.lang.Class<? extends OpenmrsSerializer> serializationClass)
SerializationService
getSerializer
in interface SerializationService
serializationClass
- - the serialization class to retrieveOpenmrsSerializer
that matches the passed classSerializationService.getSerializer(java.lang.Class)
public OpenmrsSerializer getDefaultSerializer()
SerializationService
getDefaultSerializer
in interface SerializationService
OpenmrsSerializer
the default configured serializerSerializationService.getDefaultSerializer()
public java.lang.String serialize(java.lang.Object o, java.lang.Class<? extends OpenmrsSerializer> clazz) throws SerializationException
SerializationService
OpenmrsSerializer
classserialize
in interface SerializationService
o
- - the object to serializeclazz
- - the OpenmrsSerializer
class to use for serializationSerializationException
SerializationService.serialize(java.lang.Object, java.lang.Class)
public <T> T deserialize(java.lang.String serializedObject, java.lang.Class<? extends T> objectClass, java.lang.Class<? extends OpenmrsSerializer> serializerClass) throws SerializationException
SerializationService
OpenmrsSerializer
classdeserialize
in interface SerializationService
serializedObject
- - String to deserialize into an ObjectobjectClass
- - The class to deserialize the Object intoserializerClass
- - The OpenmrsSerializer
class to use to perform the
deserializationSerializationException
SerializationService.deserialize(java.lang.String, java.lang.Class,
java.lang.Class)
public java.util.List<? extends OpenmrsSerializer> getSerializers()
SerializationService
<bean parent="serializationServiceTarget"> <property name="serializers"> <list> <ref bean="xstreamSerializer"/> </list> </property> </bean> <bean id="xstreamSerializer" class="org.openmrs.module.serialization.xstream.XStreamSerializer"/>
getSerializers
in interface SerializationService
public void setSerializers(java.util.List<? extends OpenmrsSerializer> serializers)
serializers
- the serializers to setCopyright © 2018 OpenMRS Inc.. All Rights Reserved.