Class DefaultVariableSerializers
java.lang.Object
org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers
- All Implemented Interfaces:
Serializable
,VariableSerializers
- Author:
- Tom Baeyens, Daniel Meyer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<TypedValueSerializer<?>>
protected Map<String,
TypedValueSerializer<?>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSerializer
(TypedValueSerializer<?> serializer) addSerializer
(TypedValueSerializer<?> serializer, int index) Add type at the given index.findSerializerForValue
(TypedValue value) Same as callingVariableSerializers.findSerializerForValue(TypedValue, VariableSerializerFactory)
with no fallback serializer factory.findSerializerForValue
(TypedValue value, VariableSerializerFactory fallBackSerializerFactory) Selects theTypedValueSerializer
which should be used for persisting a VariableValue.getSerializerByName
(String serializerName) int
getSerializerIndex
(TypedValueSerializer<?> serializer) int
getSerializerIndexByName
(String serializerName) Returns the serializers as a list in the order of their indices.join
(VariableSerializers other) Merges twoVariableSerializers
instances into one.removeSerializer
(TypedValueSerializer<?> serializer) void
setSerializerList
(List<TypedValueSerializer<?>> serializerList)
-
Field Details
-
serializerList
-
serializerMap
-
-
Constructor Details
-
DefaultVariableSerializers
public DefaultVariableSerializers() -
DefaultVariableSerializers
-
-
Method Details
-
getSerializerByName
- Specified by:
getSerializerByName
in interfaceVariableSerializers
- Returns:
- the serializer for the given serializerName name. Returns null if no type was found with the name.
-
findSerializerForValue
public TypedValueSerializer<?> findSerializerForValue(TypedValue value, VariableSerializerFactory fallBackSerializerFactory) Description copied from interface:VariableSerializers
Selects theTypedValueSerializer
which should be used for persisting a VariableValue.- Specified by:
findSerializerForValue
in interfaceVariableSerializers
- Parameters:
value
- the value to persistfallBackSerializerFactory
- a factory to build a fallback serializer in case no suiting serializer can be determined. If this factory is not able to build serializer either, an exception is thrown. May be null- Returns:
- the VariableValueserializer selected for persisting the value or 'null' in case no serializer can be found
-
findSerializerForValue
Description copied from interface:VariableSerializers
Same as callingVariableSerializers.findSerializerForValue(TypedValue, VariableSerializerFactory)
with no fallback serializer factory.- Specified by:
findSerializerForValue
in interfaceVariableSerializers
-
addSerializer
- Specified by:
addSerializer
in interfaceVariableSerializers
-
addSerializer
Description copied from interface:VariableSerializers
Add type at the given index. The index is used when finding a serializer for a VariableValue. When different serializers can store a specific variable value, the one with the smallest index will be used.- Specified by:
addSerializer
in interfaceVariableSerializers
-
setSerializerList
-
getSerializerIndex
- Specified by:
getSerializerIndex
in interfaceVariableSerializers
-
getSerializerIndexByName
- Specified by:
getSerializerIndexByName
in interfaceVariableSerializers
-
removeSerializer
- Specified by:
removeSerializer
in interfaceVariableSerializers
-
join
Description copied from interface:VariableSerializers
Merges twoVariableSerializers
instances into one. Implementations may apply different merging strategies.- Specified by:
join
in interfaceVariableSerializers
-
getSerializers
Description copied from interface:VariableSerializers
Returns the serializers as a list in the order of their indices.- Specified by:
getSerializers
in interfaceVariableSerializers
-