org.kuali.rice.krad.util.documentserializer
Class PropertySerializabilityEvaluatorBase

java.lang.Object
  extended by org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluatorBase
All Implemented Interfaces:
PropertySerializabilityEvaluator
Direct Known Subclasses:
AlwaysFalsePropertySerializabilityEvaluator, AlwaysTruePropertySerializibilityEvaluator, BusinessObjectPropertySerializibilityEvaluator, MaintenanceDocumentPropertySerializibilityEvaluator

public abstract class PropertySerializabilityEvaluatorBase
extends Object
implements PropertySerializabilityEvaluator

This abstract implementation provides a default implementation of determinePropertyType(Object), which should suffice for most use cases.


Field Summary
protected  PropertySerializerTrie serializableProperties
           
 
Constructor Summary
PropertySerializabilityEvaluatorBase()
           
 
Method Summary
 PropertyType determinePropertyType(Object propertyValue)
          Determines the type of a object
protected  boolean evaluateCompleteMatch(SerializationState state, Object containingObject, PropertySerializabilityMetadata metadata, String childPropertyName, Object childPropertyValue)
          Evaluates whether a property is serializable when all properties in the serialization state have been matched up with the properties defined in the data dictionary.
protected  boolean evaluatePartialMatch(SerializationState state, int lastMatchedStateIndex, Object containingObject, PropertySerializabilityMetadata metadata, String childPropertyName, Object childPropertyValue)
          Evaluates whether a property is serializable when only some of the properties in the serialization state have been matched up with the serializable properties specified in the data dictionary.
 void initializeEvaluatorForDataObject(Object businessObject)
           
 void initializeEvaluatorForDocument(Document document)
          Initializes the evaluator so that calls to #isPropertySerializable(DocumentSerializationState, Object, String, Object) and PropertySerializabilityEvaluator.determinePropertyType(Object) will function properly
protected  boolean isPrimitiveObject(Object object)
          Whether the object represents a primitive
 boolean isPropertySerializable(SerializationState state, Object containingObject, String childPropertyName, Object childPropertyValue)
          Returns whether a child property of a given containing object should be serialized, based on the metadata provided in the data dictionary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serializableProperties

protected PropertySerializerTrie serializableProperties
Constructor Detail

PropertySerializabilityEvaluatorBase

public PropertySerializabilityEvaluatorBase()
Method Detail

initializeEvaluatorForDocument

public void initializeEvaluatorForDocument(Document document)
Description copied from interface: PropertySerializabilityEvaluator
Initializes the evaluator so that calls to #isPropertySerializable(DocumentSerializationState, Object, String, Object) and PropertySerializabilityEvaluator.determinePropertyType(Object) will function properly

Specified by:
initializeEvaluatorForDocument in interface PropertySerializabilityEvaluator
Parameters:
document - the document instance

initializeEvaluatorForDataObject

public void initializeEvaluatorForDataObject(Object businessObject)
Specified by:
initializeEvaluatorForDataObject in interface PropertySerializabilityEvaluator

determinePropertyType

public PropertyType determinePropertyType(Object propertyValue)
Description copied from interface: PropertySerializabilityEvaluator
Determines the type of a object

Specified by:
determinePropertyType in interface PropertySerializabilityEvaluator
Returns:
See Also:
PropertySerializabilityEvaluator.determinePropertyType(java.lang.Object)

isPropertySerializable

public boolean isPropertySerializable(SerializationState state,
                                      Object containingObject,
                                      String childPropertyName,
                                      Object childPropertyValue)
Returns whether a child property of a given containing object should be serialized, based on the metadata provided in the data dictionary.

Specified by:
isPropertySerializable in interface PropertySerializabilityEvaluator
Parameters:
state - Information about the properties that have been serialized so far
containingObject - The object containing the reference to childPropertyValue
childPropertyName - The name property to determine whether to serialize, relative to containingObject (i.e. not a nested attribute)
childPropertyValue - If serializable, this property would be serialized by the serializer service.
Returns:
See Also:
org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluator#isPropertySerializable(org.kuali.rice.krad.util.documentserializer.DocumentSerializationState, java.lang.Object, java.lang.String, java.lang.Object)

evaluateCompleteMatch

protected boolean evaluateCompleteMatch(SerializationState state,
                                        Object containingObject,
                                        PropertySerializabilityMetadata metadata,
                                        String childPropertyName,
                                        Object childPropertyValue)
Evaluates whether a property is serializable when all properties in the serialization state have been matched up with the properties defined in the data dictionary.

Parameters:
state -
containingObject -
metadata -
childPropertyName -
childPropertyValue -
Returns:
whether the child property is serializable

evaluatePartialMatch

protected boolean evaluatePartialMatch(SerializationState state,
                                       int lastMatchedStateIndex,
                                       Object containingObject,
                                       PropertySerializabilityMetadata metadata,
                                       String childPropertyName,
                                       Object childPropertyValue)
Evaluates whether a property is serializable when only some of the properties in the serialization state have been matched up with the serializable properties specified in the data dictionary. This often occurs when we determine whether to serialize a primitive of a serialized primitive

Parameters:
state -
lastMatchedStateIndex - the index of the state parameter that represents the last matched property
containingObject - the object containing the child property
metadata - metadata of the last matched property
childPropertyName - the name of the child property that we are going to determine whether it is serializable
childPropertyValue - the value of the child property that we are going to determine whether it is serializable
Returns:
whether the child property is serializable

isPrimitiveObject

protected boolean isPrimitiveObject(Object object)
Whether the object represents a primitive

Parameters:
object -
Returns:


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.