Package org.kuali.rice.krad.service.impl
Class SerializerServiceBase
java.lang.Object
org.kuali.rice.krad.service.impl.SerializerServiceBase
- All Implemented Interfaces:
SerializerService,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
DataObjectSerializerServiceImpl,DocumentSerializerServiceImpl
public abstract class SerializerServiceBase
extends Object
implements SerializerService, org.springframework.beans.factory.InitializingBean
Default implementation of the
DocumentSerializerService. If no <workflowProperties> have been defined in the
data dictionary for a document type (i.e. Document.getDocumentPropertySerizabilityEvaluator() returns an instance of
AlwaysTruePropertySerializibilityEvaluator), then this service will revert to using the XmlObjectSerializerService
bean, which was the old way of serializing a document for routing. If workflowProperties are defined, then this implementation
will selectively serialize items.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclassclassprotected static interfaceA simple functional interface that defines a method which executes serialization to an XML string -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ThreadLocal<com.thoughtworks.xstream.io.path.PathTracker>protected ThreadLocal<PropertySerializabilityEvaluator>protected LegacyDataAdapterprotected ThreadLocal<Map<String,SerializationState>> protected XmlObjectSerializerServiceprotected com.thoughtworks.xstream.XStreamprotected org.kuali.rice.core.framework.security.XStreamSecurityService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected <T> StringdoSerialization(PropertySerializabilityEvaluator evaluator, T object, SerializerServiceBase.Serializer<T> serializer) Execute the specifiedSerializerServiceBase.Serializerwith the appropriate setup and tear down, and return the serialized XML when done.protected com.thoughtworks.xstream.io.path.PathTrackerprotected abstract PropertySerializabilityEvaluatorgetPropertySerizabilityEvaluator(Object dataObject) Get the appropriatePropertySerializabilityEvaluatorfor the given dataObject.protected XmlObjectSerializerServiceprotected booleanignoreField(Field field) Method called by the ProxyAndStateAwareJavaReflectionProvider during serialization to determine if a field should be omitted from the serialized form.serializeBusinessObjectToXml(Object businessObject) voidsetLegacyDataAdapter(LegacyDataAdapter legacyDataAdapter) voidsetXmlObjectSerializerService(XmlObjectSerializerService xmlObjectSerializerService) voidsetXStreamSecurityService(org.kuali.rice.core.framework.security.XStreamSecurityService xStreamSecurityService)
-
Field Details
-
legacyDataAdapter
-
xmlObjectSerializerService
-
xStreamSecurityService
protected org.kuali.rice.core.framework.security.XStreamSecurityService xStreamSecurityService -
xstream
protected com.thoughtworks.xstream.XStream xstream -
evaluators
-
pathToSerializationState
-
currentPathTracker
-
-
Constructor Details
-
SerializerServiceBase
public SerializerServiceBase()
-
-
Method Details
-
doSerialization
protected <T> String doSerialization(PropertySerializabilityEvaluator evaluator, T object, SerializerServiceBase.Serializer<T> serializer) Execute the specifiedSerializerServiceBase.Serializerwith the appropriate setup and tear down, and return the serialized XML when done. -
serializeBusinessObjectToXml
-
ignoreField
Method called by the ProxyAndStateAwareJavaReflectionProvider during serialization to determine if a field should be omitted from the serialized form.This is a short circuit check that will avoid more expensive calls in to the PropertySerializabilityEvaluator if it returns true.
- Parameters:
field- the field- Returns:
- true if the field should be omitted
-
getPropertySerizabilityEvaluator
protected abstract PropertySerializabilityEvaluator getPropertySerizabilityEvaluator(Object dataObject) Get the appropriatePropertySerializabilityEvaluatorfor the given dataObject.- Parameters:
dataObject- the data object- Returns:
- the evaluator
-
getCurrentPathTracker
protected com.thoughtworks.xstream.io.path.PathTracker getCurrentPathTracker() -
getXmlObjectSerializerService
-
setXmlObjectSerializerService
-
setLegacyDataAdapter
-
setXStreamSecurityService
public void setXStreamSecurityService(org.kuali.rice.core.framework.security.XStreamSecurityService xStreamSecurityService) -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-