Package org.operaton.spin.plugin.impl
Class SpinValueSerializer
java.lang.Object
org.operaton.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer<SpinValue>
org.operaton.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer<SpinValue>
org.operaton.spin.plugin.impl.SpinValueSerializer
- All Implemented Interfaces:
TypedValueSerializer<SpinValue>
- Direct Known Subclasses:
JsonValueSerializer,XmlValueSerializer
- Author:
- Roman Smirnov
-
Field Summary
FieldsFields inherited from class org.operaton.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer
serializationDataFormatFields inherited from class org.operaton.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer
BINARY_VALUE_TYPES, valueType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSpinValueSerializer(SerializableValueType type, DataFormat<?> dataFormat, String name) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanSerializeValue(Object value) return true if this serializer is able to serialize the provided object.protected ObjectdeserializeFromByteArray(byte[] object, ValueFields valueFields) Deserialize the object from a byte array.getName()The name of this serializer.protected booleanReturn true if the serialization is text based.protected byte[]serializeToByteArray(Object deserializedObject) Implementations must return a byte[] representation of the provided object.protected voidupdateTypedValue(SpinValue value, String serializedStringValue) Updates the typed value with the serialized string representation.protected voidwriteToValueFields(SpinValue value, ValueFields valueFields, byte[] serializedValue) Writes the serialized value to the provided value fields.Methods inherited from class org.operaton.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer
canWriteValue, createDeserializedValue, createSerializedValue, getSerializationDataformat, getSerializedBytesValue, getSerializedStringValue, readSerializedValueFromFields, readValue, writeValueMethods inherited from class org.operaton.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer
canHandle, getType, isMutableValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.operaton.bpm.engine.impl.variable.serializer.TypedValueSerializer
convertToTypedValue
-
Field Details
-
dataFormat
-
name
-
-
Constructor Details
-
SpinValueSerializer
-
-
Method Details
-
getName
Description copied from interface:TypedValueSerializerThe name of this serializer. The name is used when persisting the ValueFields populated by this serializer.- Returns:
- the name of this serializer.
-
writeToValueFields
Description copied from class:AbstractSerializableValueSerializerWrites the serialized value to the provided value fields.- Specified by:
writeToValueFieldsin classAbstractSerializableValueSerializer<SpinValue>- Parameters:
value- the value to writevalueFields- the fields to write toserializedValue- the serialized value as a byte array
-
updateTypedValue
Description copied from class:AbstractSerializableValueSerializerUpdates the typed value with the serialized string representation.- Specified by:
updateTypedValuein classAbstractSerializableValueSerializer<SpinValue>- Parameters:
value- the typed value to updateserializedStringValue- the serialized string representation
-
canSerializeValue
Description copied from class:AbstractSerializableValueSerializerreturn true if this serializer is able to serialize the provided object.- Specified by:
canSerializeValuein classAbstractSerializableValueSerializer<SpinValue>- Parameters:
value- the object to test (guaranteed to be a non-null value)- Returns:
- true if the serializer can handle the object.
-
serializeToByteArray
Description copied from class:AbstractSerializableValueSerializerImplementations must return a byte[] representation of the provided object. The object is guaranteed not to be null.- Specified by:
serializeToByteArrayin classAbstractSerializableValueSerializer<SpinValue>- Parameters:
deserializedObject- the object to serialize- Returns:
- the byte array value of the object
-
deserializeFromByteArray
Description copied from class:AbstractSerializableValueSerializerDeserialize the object from a byte array.- Specified by:
deserializeFromByteArrayin classAbstractSerializableValueSerializer<SpinValue>- Parameters:
object- the object to deserializevalueFields- the value fields- Returns:
- the deserialized object
-
isSerializationTextBased
protected boolean isSerializationTextBased()Description copied from class:AbstractSerializableValueSerializerReturn true if the serialization is text based. Return false otherwise- Specified by:
isSerializationTextBasedin classAbstractSerializableValueSerializer<SpinValue>
-