public class SpinObjectValueSerializer extends AbstractObjectValueSerializer
TypedValueSerializer
for ObjectValues
using a
Spin-provided DataFormat
to serialize and deserialize java objects.Modifier and Type | Field and Description |
---|---|
protected org.camunda.spin.spi.DataFormat<?> |
dataFormat |
protected String |
name |
serializationDataFormat
BINARY_VALUE_TYPES, valueType
Constructor and Description |
---|
SpinObjectValueSerializer(String name,
org.camunda.spin.spi.DataFormat<?> dataFormat) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canSerializeValue(Object value)
return true if this serializer is able to serialize the provided object.
|
protected Object |
deserializeFromByteArray(byte[] bytes,
String objectTypeName)
Deserialize the object from a byte array.
|
String |
getName()
The name of this serializer.
|
protected String |
getTypeNameForDeserialized(Object deserializedObject)
Returns the type name for the deserialized object.
|
protected boolean |
isSerializationTextBased()
Return true if the serialization is text based.
|
protected byte[] |
serializeToByteArray(Object deserializedObject)
Implementations must return a byte[] representation of the provided object.
|
convertToTypedValue, createDeserializedValue, createSerializedValue, deserializeFromByteArray, getObjectTypeName, isMutableValue, readObjectNameFromFields, updateTypedValue, writeToValueFields
canWriteValue, getSerializationDataformat, getSerializedBytesValue, getSerializedStringValue, readSerializedValueFromFields, readValue, writeValue
canHandle, getType
protected String name
protected org.camunda.spin.spi.DataFormat<?> dataFormat
public SpinObjectValueSerializer(String name, org.camunda.spin.spi.DataFormat<?> dataFormat)
public String getName()
TypedValueSerializer
protected boolean isSerializationTextBased()
AbstractObjectValueSerializer
isSerializationTextBased
in class AbstractObjectValueSerializer
protected String getTypeNameForDeserialized(Object deserializedObject)
AbstractObjectValueSerializer
getTypeNameForDeserialized
in class AbstractObjectValueSerializer
protected byte[] serializeToByteArray(Object deserializedObject) throws Exception
AbstractObjectValueSerializer
serializeToByteArray
in class AbstractObjectValueSerializer
deserializedObject
- the object to serializeException
protected Object deserializeFromByteArray(byte[] bytes, String objectTypeName) throws Exception
AbstractObjectValueSerializer
deserializeFromByteArray
in class AbstractObjectValueSerializer
bytes
- the object to deserializeobjectTypeName
- the type name of the object to deserializeException
protected boolean canSerializeValue(Object value)
AbstractSerializableValueSerializer
canSerializeValue
in class AbstractSerializableValueSerializer<org.camunda.bpm.engine.variable.value.ObjectValue>
value
- the object to test (guaranteed to be a non-null value)Copyright © 2017. All rights reserved.