public interface SerializationService extends OpenmrsService
Modifier and Type | Method and Description |
---|---|
<T> T |
deserialize(String serializedObject,
Class<? extends T> objectClass,
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(Class<? extends OpenmrsSerializer> serializationClass)
Returns the serializer that matches the passed class, or null if no such serializer exists.
|
List<? extends OpenmrsSerializer> |
getSerializers()
Gets the list of OpenmrsSerializers that have been registered with this service.
|
String |
serialize(Object o,
Class<? extends OpenmrsSerializer> clazz)
Serialize the passed object into an identifying string that can be retrieved later using the
passed
OpenmrsSerializer class |
onShutdown, onStartup
OpenmrsSerializer getDefaultSerializer()
OpenmrsSerializer
the default configured serializer
Should return a serializerOpenmrsSerializer getSerializer(Class<? extends OpenmrsSerializer> serializationClass)
serializationClass
- - the serialization class to retrieveOpenmrsSerializer
that matches the passed class
Should return a serializer of the given classString serialize(Object o, Class<? extends OpenmrsSerializer> clazz) throws SerializationException
OpenmrsSerializer
classo
- - the object to serializeclazz
- - the OpenmrsSerializer
class to use for serializationSerializationException
@Logging(ignoredArgumentIndexes=0) @Authorized <T> T deserialize(String serializedObject, Class<? extends T> objectClass, Class<? extends OpenmrsSerializer> serializerClass) throws SerializationException
OpenmrsSerializer
classserializedObject
- - String to deserialize into an ObjectobjectClass
- - The class to deserialize the Object intoserializerClass
- - The OpenmrsSerializer
class to use to perform the
deserializationSerializationException
List<? extends OpenmrsSerializer> getSerializers()
<bean parent="serializationServiceTarget"> <property name="serializers"> <list> <ref bean="xstreamSerializer"/> </list> </property> </bean> <bean id="xstreamSerializer" class="org.openmrs.module.serialization.xstream.XStreamSerializer"/>
Copyright © 2024 OpenMRS Inc.. All rights reserved.