public abstract class AbstractSerializableValueSerializer<T extends org.camunda.bpm.engine.variable.value.SerializableValue> extends AbstractTypedValueSerializer<T>
Modifier and Type | Field and Description |
---|---|
protected String |
serializationDataFormat |
BINARY_VALUE_TYPES, valueType
Constructor and Description |
---|
AbstractSerializableValueSerializer(org.camunda.bpm.engine.variable.type.SerializableValueType type,
String serializationDataFormat) |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
canSerializeValue(Object value)
return true if this serializer is able to serialize the provided object.
|
protected boolean |
canWriteValue(org.camunda.bpm.engine.variable.value.TypedValue typedValue) |
protected abstract T |
createDeserializedValue(Object deserializedObject,
String serializedStringValue,
ValueFields valueFields) |
protected abstract T |
createSerializedValue(String serializedStringValue,
ValueFields valueFields) |
protected abstract Object |
deserializeFromByteArray(byte[] object,
ValueFields valueFields)
Deserialize the object from a byte array.
|
String |
getSerializationDataformat() |
protected byte[] |
getSerializedBytesValue(String serializedStringValue) |
protected String |
getSerializedStringValue(byte[] serializedByteValue) |
protected abstract boolean |
isSerializationTextBased()
Return true if the serialization is text based.
|
protected byte[] |
readSerializedValueFromFields(ValueFields valueFields) |
T |
readValue(ValueFields valueFields,
boolean deserializeObjectValue)
Retrieve a
TypedValue from the provided ValueFields . |
protected abstract byte[] |
serializeToByteArray(Object deserializedObject)
Implementations must return a byte[] representation of the provided object.
|
protected abstract void |
updateTypedValue(T value,
String serializedStringValue) |
protected abstract void |
writeToValueFields(T value,
ValueFields valueFields,
byte[] serializedValue) |
void |
writeValue(T value,
ValueFields valueFields)
Serialize a
TypedValue to the ValueFields . |
canHandle, getType, isMutableValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertToTypedValue, getName
protected String serializationDataFormat
public AbstractSerializableValueSerializer(org.camunda.bpm.engine.variable.type.SerializableValueType type, String serializationDataFormat)
public String getSerializationDataformat()
getSerializationDataformat
in interface TypedValueSerializer<T extends org.camunda.bpm.engine.variable.value.SerializableValue>
getSerializationDataformat
in class AbstractTypedValueSerializer<T extends org.camunda.bpm.engine.variable.value.SerializableValue>
public void writeValue(T value, ValueFields valueFields)
TypedValueSerializer
TypedValue
to the ValueFields
.value
- the TypedValue
to persistvalueFields
- the ValueFields
to which the value should be persistedpublic T readValue(ValueFields valueFields, boolean deserializeObjectValue)
TypedValueSerializer
TypedValue
from the provided ValueFields
.valueFields
- the ValueFields
to retrieve the value fromdeserializeObjectValue
- indicates whether a SerializableValue
should be deserialized.TypedValue
protected abstract T createDeserializedValue(Object deserializedObject, String serializedStringValue, ValueFields valueFields)
protected abstract T createSerializedValue(String serializedStringValue, ValueFields valueFields)
protected abstract void writeToValueFields(T value, ValueFields valueFields, byte[] serializedValue)
protected byte[] readSerializedValueFromFields(ValueFields valueFields)
protected String getSerializedStringValue(byte[] serializedByteValue)
protected byte[] getSerializedBytesValue(String serializedStringValue)
protected boolean canWriteValue(org.camunda.bpm.engine.variable.value.TypedValue typedValue)
canWriteValue
in class AbstractTypedValueSerializer<T extends org.camunda.bpm.engine.variable.value.SerializableValue>
protected abstract boolean canSerializeValue(Object value)
value
- the object to test (guaranteed to be a non-null value)protected abstract byte[] serializeToByteArray(Object deserializedObject) throws Exception
deserializedObject
- the object to serializeexception
- in case the object cannot be serializedException
protected abstract Object deserializeFromByteArray(byte[] object, ValueFields valueFields) throws Exception
object
- the object to deserializevalueFields
- the value fieldsexception
- in case the object cannot be deserializedException
protected abstract boolean isSerializationTextBased()
Copyright © 2018. All rights reserved.