Top Fields Constructors Methods
com.fasterxml.jackson.databind.cfg

public Class CoercionConfigs

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.HashMap, .Map, com.fasterxml.jackson.databind.DeserializationConfig, .DeserializationFeature, .MapperFeature, com.fasterxml.jackson.databind.type.LogicalType

Since
2.12

Field Summary

Modifier and TypeField and Description
protected CoercionAction
_defaultAction

Global default for cases not explicitly covered

protected final MutableCoercionConfig
_defaultCoercions

Default coercion definitions used if no overrides found by logical or physical type.

protected Map<Class<?>, MutableCoercionConfig>
_perClassCoercions

Coercion definitions by physical type (Class).

protected MutableCoercionConfig[]
_perTypeCoercions

Coercion definitions by logical type (LogicalType)

private static final long
private static final int

Constructor Summary

AccessConstructor and Description
public
protected
CoercionConfigs(CoercionAction defaultAction, MutableCoercionConfig defaultCoercions, MutableCoercionConfig[] perTypeCoercions, Map<Class<?>, MutableCoercionConfig> perClassCoercions)

Method Summary

Modifier and TypeMethod and Description
private static MutableCoercionConfig
protected boolean
public CoercionConfigs

Returns:

A non-shared copy of configuration settings
copy
()

Method called to create a non-shared copy of configuration settings, to be used by another com.fasterxml.jackson.databind.ObjectMapper instance.

public MutableCoercionConfig
public CoercionAction

Returns:

CoercionAction configured for specified coercion
findCoercion
(DeserializationConfig
Currently active deserialization configuration
config
,
LogicalType
Logical target type of coercion
targetType
,
Class<?>
Physical target type of coercion
targetClass
,
CoercionInputShape
Input shape to coerce from
inputShape
)

General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.

public CoercionAction

Returns:

CoercionAction configured for specified coercion from blank string
findCoercionFromBlankString
(DeserializationConfig
Currently active deserialization configuration
config
,
LogicalType
Logical target type of coercion
targetType
,
Class<?>
Physical target type of coercion
targetClass
,
CoercionAction
Return value to use in case "blanks as empty" is not allowed
actionIfBlankNotAllowed
)

More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one).

public MutableCoercionConfig
public MutableCoercionConfig
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_defaultActionback to summary
protected CoercionAction _defaultAction

Global default for cases not explicitly covered

_defaultCoercionsback to summary
protected final MutableCoercionConfig _defaultCoercions

Default coercion definitions used if no overrides found by logical or physical type.

_perClassCoercionsback to summary
protected Map<Class<?>, MutableCoercionConfig> _perClassCoercions

Coercion definitions by physical type (Class).

_perTypeCoercionsback to summary
protected MutableCoercionConfig[] _perTypeCoercions

Coercion definitions by logical type (LogicalType)

serialVersionUIDback to summary
private static final long serialVersionUID
TARGET_TYPE_COUNTback to summary
private static final int TARGET_TYPE_COUNT

Constructor Detail

CoercionConfigsback to summary
public CoercionConfigs()
CoercionConfigsback to summary
protected CoercionConfigs(CoercionAction defaultAction, MutableCoercionConfig defaultCoercions, MutableCoercionConfig[] perTypeCoercions, Map<Class<?>, MutableCoercionConfig> perClassCoercions)

Method Detail

_copyback to summary
private static MutableCoercionConfig _copy(MutableCoercionConfig src)
_isScalarTypeback to summary
protected boolean _isScalarType(LogicalType targetType)
copyback to summary
public CoercionConfigs copy()

Method called to create a non-shared copy of configuration settings, to be used by another com.fasterxml.jackson.databind.ObjectMapper instance.

Returns:CoercionConfigs

A non-shared copy of configuration settings

defaultCoercionsback to summary
public MutableCoercionConfig defaultCoercions()
findCoercionback to summary
public CoercionAction findCoercion(DeserializationConfig config, LogicalType targetType, Class<?> targetClass, CoercionInputShape inputShape)

General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.

Parameters
config:DeserializationConfig

Currently active deserialization configuration

targetType:LogicalType

Logical target type of coercion

targetClass:Class<?>

Physical target type of coercion

inputShape:CoercionInputShape

Input shape to coerce from

Returns:CoercionAction

CoercionAction configured for specified coercion

Since
2.12
findCoercionFromBlankStringback to summary
public CoercionAction findCoercionFromBlankString(DeserializationConfig config, LogicalType targetType, Class<?> targetClass, CoercionAction actionIfBlankNotAllowed)

More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one). Will basically first determine if "blank as empty" is allowed: if not, returns actionIfBlankNotAllowed, otherwise returns action for CoercionInputShape#EmptyString.

Parameters
config:DeserializationConfig

Currently active deserialization configuration

targetType:LogicalType

Logical target type of coercion

targetClass:Class<?>

Physical target type of coercion

actionIfBlankNotAllowed:CoercionAction

Return value to use in case "blanks as empty" is not allowed

Returns:CoercionAction

CoercionAction configured for specified coercion from blank string

findOrCreateCoercionback to summary
public MutableCoercionConfig findOrCreateCoercion(LogicalType type)
findOrCreateCoercionback to summary
public MutableCoercionConfig findOrCreateCoercion(Class<?> type)