org.camunda.bpm.engine.impl.variable.serializer
Class JavaObjectSerializer

java.lang.Object
  extended by org.camunda.bpm.engine.impl.variable.serializer.AbstractTypedValueSerializer<T>
      extended by org.camunda.bpm.engine.impl.variable.serializer.AbstractSerializableValueSerializer<org.camunda.bpm.engine.variable.value.ObjectValue>
          extended by org.camunda.bpm.engine.impl.variable.serializer.AbstractObjectValueSerializer
              extended by org.camunda.bpm.engine.impl.variable.serializer.JavaObjectSerializer
All Implemented Interfaces:
TypedValueSerializer<org.camunda.bpm.engine.variable.value.ObjectValue>

public class JavaObjectSerializer
extends AbstractObjectValueSerializer

Uses default java serialization to serialize java objects as byte streams.

Author:
Daniel Meyer, Tom Baeyens

Nested Class Summary
protected static class JavaObjectSerializer.ClassloaderAwareObjectInputStream
           
 
Field Summary
static String NAME
           
 
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
JavaObjectSerializer()
           
 
Method Summary
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.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

JavaObjectSerializer

public JavaObjectSerializer()
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.

isSerializationTextBased

protected boolean isSerializationTextBased()
Description copied from class: AbstractObjectValueSerializer
Return true if the serialization is text based. Return false otherwise

Specified by:
isSerializationTextBased in class AbstractObjectValueSerializer

deserializeFromByteArray

protected Object deserializeFromByteArray(byte[] bytes,
                                          String objectTypeName)
                                   throws Exception
Description copied from class: AbstractObjectValueSerializer
Deserialize the object from a byte array.

Specified by:
deserializeFromByteArray in class AbstractObjectValueSerializer
Parameters:
bytes - the object to deserialize
objectTypeName - the type name of the object to deserialize
Returns:
the deserialized object
Throws:
Exception

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 class AbstractObjectValueSerializer
Parameters:
deserializedObject - the object to serialize
Returns:
the byte array value of the object
Throws:
Exception

getTypeNameForDeserialized

protected String getTypeNameForDeserialized(Object deserializedObject)
Description copied from class: AbstractObjectValueSerializer
Returns the type name for the deserialized object.

Specified by:
getTypeNameForDeserialized in class AbstractObjectValueSerializer
Returns:
the type name fot the object.

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 class AbstractSerializableValueSerializer<org.camunda.bpm.engine.variable.value.ObjectValue>
Parameters:
value - the object to test (guaranteed to be a non-null value)
Returns:
true if the serializer can handle the object.


Copyright © 2016 camunda services GmbH. All rights reserved.