public abstract class AbstractObjectValueSerializer extends AbstractSerializableValueSerializer<ObjectValue>
TypedValueSerializer
for ObjectValues
.serializationDataFormat
BINARY_VALUE_TYPES, valueType
Constructor and Description |
---|
AbstractObjectValueSerializer(String serializationDataFormat) |
Modifier and Type | Method and Description |
---|---|
ObjectValue |
convertToTypedValue(UntypedValueImpl untypedValue)
Returns a typed value for the provided untyped value.
|
protected ObjectValue |
createDeserializedValue(Object deserializedObject,
String serializedStringValue,
ValueFields valueFields,
boolean asTransientValue) |
protected ObjectValue |
createSerializedValue(String serializedStringValue,
ValueFields valueFields,
boolean asTransientValue) |
protected abstract Object |
deserializeFromByteArray(byte[] object,
String objectTypeName)
Deserialize the object from a byte array.
|
protected Object |
deserializeFromByteArray(byte[] object,
ValueFields valueFields)
Deserialize the object from a byte array.
|
protected String |
getObjectTypeName(ObjectValue value,
ValueFields valueFields) |
protected abstract String |
getTypeNameForDeserialized(Object deserializedObject)
Returns the type name for the deserialized object.
|
boolean |
isMutableValue(ObjectValue typedValue) |
protected abstract boolean |
isSerializationTextBased()
Return true if the serialization is text based.
|
protected String |
readObjectNameFromFields(ValueFields valueFields) |
protected abstract byte[] |
serializeToByteArray(Object deserializedObject)
Implementations must return a byte[] representation of the provided object.
|
protected void |
updateTypedValue(ObjectValue value,
String serializedStringValue) |
protected void |
writeToValueFields(ObjectValue value,
ValueFields valueFields,
byte[] serializedValue) |
canSerializeValue, canWriteValue, getSerializationDataformat, getSerializedBytesValue, getSerializedStringValue, readSerializedValueFromFields, readValue, writeValue
canHandle, getType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public AbstractObjectValueSerializer(String serializationDataFormat)
public ObjectValue convertToTypedValue(UntypedValueImpl untypedValue)
TypedValueSerializer
TypedValueSerializer
(by invocation of TypedValueSerializer.canHandle(TypedValue)
).untypedValue
- the untyped valueprotected void writeToValueFields(ObjectValue value, ValueFields valueFields, byte[] serializedValue)
writeToValueFields
in class AbstractSerializableValueSerializer<ObjectValue>
protected String getObjectTypeName(ObjectValue value, ValueFields valueFields)
protected void updateTypedValue(ObjectValue value, String serializedStringValue)
updateTypedValue
in class AbstractSerializableValueSerializer<ObjectValue>
protected ObjectValue createDeserializedValue(Object deserializedObject, String serializedStringValue, ValueFields valueFields, boolean asTransientValue)
createDeserializedValue
in class AbstractSerializableValueSerializer<ObjectValue>
protected ObjectValue createSerializedValue(String serializedStringValue, ValueFields valueFields, boolean asTransientValue)
createSerializedValue
in class AbstractSerializableValueSerializer<ObjectValue>
protected String readObjectNameFromFields(ValueFields valueFields)
public boolean isMutableValue(ObjectValue typedValue)
isMutableValue
in interface TypedValueSerializer<ObjectValue>
isMutableValue
in class AbstractTypedValueSerializer<ObjectValue>
protected abstract String getTypeNameForDeserialized(Object deserializedObject)
deserializedObject.
- Guaranteed not to be nullprotected abstract byte[] serializeToByteArray(Object deserializedObject) throws Exception
serializeToByteArray
in class AbstractSerializableValueSerializer<ObjectValue>
deserializedObject
- the object to serializeexception
- in case the object cannot be serializedException
protected Object deserializeFromByteArray(byte[] object, ValueFields valueFields) throws Exception
AbstractSerializableValueSerializer
deserializeFromByteArray
in class AbstractSerializableValueSerializer<ObjectValue>
object
- the object to deserializevalueFields
- the value fieldsException
protected abstract Object deserializeFromByteArray(byte[] object, String objectTypeName) throws Exception
object
- the object to deserializeobjectTypeName
- the type name of the object to deserializeexception
- in case the object cannot be deserializedException
protected abstract boolean isSerializationTextBased()
isSerializationTextBased
in class AbstractSerializableValueSerializer<ObjectValue>
Copyright © 2021. All rights reserved.