Class DefaultVariableSerializers
- java.lang.Object
-
- org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers
-
- All Implemented Interfaces:
Serializable
,VariableSerializers
public class DefaultVariableSerializers extends Object implements Serializable, VariableSerializers
- Author:
- Tom Baeyens, Daniel Meyer
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<TypedValueSerializer<?>>
serializerList
protected Map<String,TypedValueSerializer<?>>
serializerMap
-
Constructor Summary
Constructors Constructor Description DefaultVariableSerializers()
DefaultVariableSerializers(DefaultVariableSerializers serializers)
-
Method Summary
-
-
-
Field Detail
-
serializerList
protected List<TypedValueSerializer<?>> serializerList
-
serializerMap
protected Map<String,TypedValueSerializer<?>> serializerMap
-
-
Constructor Detail
-
DefaultVariableSerializers
public DefaultVariableSerializers()
-
DefaultVariableSerializers
public DefaultVariableSerializers(DefaultVariableSerializers serializers)
-
-
Method Detail
-
getSerializerByName
public TypedValueSerializer<?> getSerializerByName(String serializerName)
- 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
public TypedValueSerializer<?> findSerializerForValue(TypedValue value)
Description copied from interface:VariableSerializers
Same as callingVariableSerializers.findSerializerForValue(TypedValue, VariableSerializerFactory)
with no fallback serializer factory.- Specified by:
findSerializerForValue
in interfaceVariableSerializers
-
addSerializer
public DefaultVariableSerializers addSerializer(TypedValueSerializer<?> serializer)
- Specified by:
addSerializer
in interfaceVariableSerializers
-
addSerializer
public DefaultVariableSerializers addSerializer(TypedValueSerializer<?> serializer, int index)
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
public void setSerializerList(List<TypedValueSerializer<?>> serializerList)
-
getSerializerIndex
public int getSerializerIndex(TypedValueSerializer<?> serializer)
- Specified by:
getSerializerIndex
in interfaceVariableSerializers
-
getSerializerIndexByName
public int getSerializerIndexByName(String serializerName)
- Specified by:
getSerializerIndexByName
in interfaceVariableSerializers
-
removeSerializer
public VariableSerializers removeSerializer(TypedValueSerializer<?> serializer)
- Specified by:
removeSerializer
in interfaceVariableSerializers
-
join
public VariableSerializers join(VariableSerializers other)
Description copied from interface:VariableSerializers
Merges twoVariableSerializers
instances into one. Implementations may apply different merging strategies.- Specified by:
join
in interfaceVariableSerializers
-
getSerializers
public List<TypedValueSerializer<?>> getSerializers()
Description copied from interface:VariableSerializers
Returns the serializers as a list in the order of their indices.- Specified by:
getSerializers
in interfaceVariableSerializers
-
-