Class SerializerServiceBase

java.lang.Object
org.kuali.rice.krad.service.impl.SerializerServiceBase
All Implemented Interfaces:
org.kuali.rice.krad.service.SerializerService, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
DataObjectSerializerServiceImpl, DocumentSerializerServiceImpl

public abstract class SerializerServiceBase extends Object implements org.kuali.rice.krad.service.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)
  • Field Details

    • legacyDataAdapter

      protected org.kuali.rice.krad.service.LegacyDataAdapter legacyDataAdapter
    • xmlObjectSerializerService

      protected org.kuali.rice.krad.service.XmlObjectSerializerService xmlObjectSerializerService
    • xStreamSecurityService

      protected org.kuali.rice.core.framework.security.XStreamSecurityService xStreamSecurityService
    • xstream

      protected com.thoughtworks.xstream.XStream xstream
    • evaluators

      protected ThreadLocal<org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluator> evaluators
    • pathToSerializationState

      protected ThreadLocal<Map<String,org.kuali.rice.krad.util.documentserializer.SerializationState>> pathToSerializationState
    • currentPathTracker

      protected ThreadLocal<com.thoughtworks.xstream.io.path.PathTracker> currentPathTracker
  • Constructor Details

    • SerializerServiceBase

      public SerializerServiceBase()
  • Method Details

    • doSerialization

      protected <T> String doSerialization(org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluator evaluator, T object, SerializerServiceBase.Serializer<T> serializer)
      Execute the specified SerializerServiceBase.Serializer with the appropriate setup and tear down, and return the serialized XML when done.
    • serializeBusinessObjectToXml

      public String serializeBusinessObjectToXml(Object businessObject)
    • ignoreField

      protected boolean ignoreField(Field field)
      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 org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluator getPropertySerizabilityEvaluator(Object dataObject)
      Get the appropriate PropertySerializabilityEvaluator for the given dataObject.
      Parameters:
      dataObject - the data object
      Returns:
      the evaluator
    • getCurrentPathTracker

      protected com.thoughtworks.xstream.io.path.PathTracker getCurrentPathTracker()
    • getXmlObjectSerializerService

      protected org.kuali.rice.krad.service.XmlObjectSerializerService getXmlObjectSerializerService()
    • setXmlObjectSerializerService

      public void setXmlObjectSerializerService(org.kuali.rice.krad.service.XmlObjectSerializerService xmlObjectSerializerService)
    • setLegacyDataAdapter

      public void setLegacyDataAdapter(org.kuali.rice.krad.service.LegacyDataAdapter legacyDataAdapter)
    • setXStreamSecurityService

      public void setXStreamSecurityService(org.kuali.rice.core.framework.security.XStreamSecurityService xStreamSecurityService)
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean