Package org.camunda.spin.plugin.impl
Class FallbackSpinObjectValueSerializer
- java.lang.Object
-
- org.camunda.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer<T>
-
- org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer<ObjectValue>
-
- org.camunda.bpm.engine.impl.variable.serializer.AbstractObjectValueSerializer
-
- org.camunda.spin.plugin.impl.FallbackSpinObjectValueSerializer
-
- All Implemented Interfaces:
TypedValueSerializer<ObjectValue>
public class FallbackSpinObjectValueSerializer extends AbstractObjectValueSerializer
- Author:
- Thorben Lindhauer
-
-
Field Summary
Fields Modifier and Type Field Description static String
DESERIALIZED_OBJECTS_EXCEPTION_MESSAGE
protected String
serializationFormat
-
Fields inherited from class org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer
serializationDataFormat
-
Fields inherited from class org.camunda.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer
BINARY_VALUE_TYPES, valueType
-
-
Constructor Summary
Constructors Constructor Description FallbackSpinObjectValueSerializer(String serializationFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canSerializeValue(Object value)
return true if this serializer is able to serialize the provided object.protected Object
deserializeFromByteArray(byte[] object, 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.-
Methods inherited from class org.camunda.bpm.engine.impl.variable.serializer.AbstractObjectValueSerializer
convertToTypedValue, createDeserializedValue, createSerializedValue, deserializeFromByteArray, getObjectTypeName, isMutableValue, readObjectNameFromFields, updateTypedValue, writeToValueFields
-
Methods inherited from class org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer
canWriteValue, getSerializationDataformat, getSerializedBytesValue, getSerializedStringValue, readSerializedValueFromFields, readValue, writeValue
-
Methods inherited from class org.camunda.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer
canHandle, getType
-
-
-
-
Field Detail
-
DESERIALIZED_OBJECTS_EXCEPTION_MESSAGE
public static final String DESERIALIZED_OBJECTS_EXCEPTION_MESSAGE
- See Also:
- Constant Field Values
-
serializationFormat
protected String serializationFormat
-
-
Constructor Detail
-
FallbackSpinObjectValueSerializer
public FallbackSpinObjectValueSerializer(String serializationFormat)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:TypedValueSerializer
The name of this serializer. The name is used when persisting the ValueFields populated by this serializer.- Returns:
- the name of this serializer.
-
getTypeNameForDeserialized
protected String getTypeNameForDeserialized(Object deserializedObject)
Description copied from class:AbstractObjectValueSerializer
Returns the type name for the deserialized object.- Specified by:
getTypeNameForDeserialized
in classAbstractObjectValueSerializer
- Parameters:
deserializedObject
- . Guaranteed not to be null- Returns:
- the type name fot the object.
-
serializeToByteArray
protected byte[] serializeToByteArray(Object deserializedObject) throws Exception
Description copied from class:AbstractObjectValueSerializer
Implementations must return a byte[] representation of the provided object. The object is guaranteed not to be null.- Specified by:
serializeToByteArray
in classAbstractObjectValueSerializer
- Parameters:
deserializedObject
- the object to serialize- Returns:
- the byte array value of the object
- Throws:
Exception
-
deserializeFromByteArray
protected Object deserializeFromByteArray(byte[] object, String objectTypeName) throws Exception
Description copied from class:AbstractObjectValueSerializer
Deserialize the object from a byte array.- Specified by:
deserializeFromByteArray
in classAbstractObjectValueSerializer
- Parameters:
object
- the object to deserializeobjectTypeName
- the type name of the object to deserialize- Returns:
- the deserialized object
- Throws:
Exception
-
isSerializationTextBased
protected boolean isSerializationTextBased()
Description copied from class:AbstractObjectValueSerializer
Return true if the serialization is text based. Return false otherwise- Specified by:
isSerializationTextBased
in classAbstractObjectValueSerializer
-
canSerializeValue
protected boolean canSerializeValue(Object value)
Description copied from class:AbstractSerializableValueSerializer
return true if this serializer is able to serialize the provided object.- Specified by:
canSerializeValue
in classAbstractSerializableValueSerializer<ObjectValue>
- Parameters:
value
- the object to test (guaranteed to be a non-null value)- Returns:
- true if the serializer can handle the object.
-
-