Class PropertySerializabilityEvaluatorBase
java.lang.Object
org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluatorBase
- All Implemented Interfaces:
PropertySerializabilityEvaluator
- Direct Known Subclasses:
AlwaysFalsePropertySerializabilityEvaluator,AlwaysTruePropertySerializibilityEvaluator,BusinessObjectPropertySerializibilityEvaluator,MetadataPropertySerializabilityEvaluator
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeterminePropertyType(Object propertyValue) Determines the type of a objectprotected booleanevaluateCompleteMatch(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 booleanevaluatePartialMatch(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.voidinitializeEvaluatorForDataObject(Object businessObject) voidinitializeEvaluatorForDocument(Document document) Initializes the evaluator so that calls toPropertySerializabilityEvaluator.isPropertySerializable(SerializationState, Object, String, Object)andPropertySerializabilityEvaluator.determinePropertyType(Object)will function properlyprotected booleanisPrimitiveObject(Object object) Whether the object represents a primitivebooleanisPropertySerializable(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.
-
Field Details
-
serializableProperties
-
-
Constructor Details
-
PropertySerializabilityEvaluatorBase
public PropertySerializabilityEvaluatorBase()
-
-
Method Details
-
initializeEvaluatorForDocument
Description copied from interface:PropertySerializabilityEvaluatorInitializes the evaluator so that calls toPropertySerializabilityEvaluator.isPropertySerializable(SerializationState, Object, String, Object)andPropertySerializabilityEvaluator.determinePropertyType(Object)will function properly- Specified by:
initializeEvaluatorForDocumentin interfacePropertySerializabilityEvaluator- Parameters:
document- the document instance
-
initializeEvaluatorForDataObject
- Specified by:
initializeEvaluatorForDataObjectin interfacePropertySerializabilityEvaluator
-
determinePropertyType
Description copied from interface:PropertySerializabilityEvaluatorDetermines the type of a object- Specified by:
determinePropertyTypein interfacePropertySerializabilityEvaluator- Parameters:
propertyValue-- Returns:
- See Also:
-
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:
isPropertySerializablein interfacePropertySerializabilityEvaluator- Parameters:
state- Information about the properties that have been serialized so farcontainingObject- The object containing the reference to childPropertyValuechildPropertyName- 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:
-
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 propertycontainingObject- the object containing the child propertymetadata- metadata of the last matched propertychildPropertyName- the name of the child property that we are going to determine whether it is serializablechildPropertyValue- the value of the child property that we are going to determine whether it is serializable- Returns:
- whether the child property is serializable
-
isPrimitiveObject
Whether the object represents a primitive- Parameters:
object-- Returns:
-