|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openmrs.api.impl.BaseOpenmrsService org.openmrs.api.impl.SerializationServiceImpl
@Transactional public class SerializationServiceImpl
Contains methods for retrieving registered OpenmrsSerializer instances, and for persisting/retrieving/deleting objects using serialization
Field Summary | |
---|---|
org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
SerializationServiceImpl()
|
Method Summary | ||
---|---|---|
|
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)
|
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService |
---|
onShutdown, onStartup |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.openmrs.api.OpenmrsService |
---|
onShutdown, onStartup |
Field Detail |
---|
public org.apache.commons.logging.Log log
Constructor Detail |
---|
public SerializationServiceImpl()
Method Detail |
---|
public OpenmrsSerializer getSerializer(java.lang.Class<? extends OpenmrsSerializer> serializationClass)
SerializationService
getSerializer
in interface SerializationService
serializationClass
- - the serialization class to retrieve
OpenmrsSerializer
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
class
serialize
in interface SerializationService
o
- - the object to serializeclazz
- - the OpenmrsSerializer
class to use for serialization
SerializationException
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
class
deserialize
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
deserialization
SerializationException
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 set
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |