Top Description Fields Constructors Methods
tools.jackson.databind.deser

public abstract Class ValueDeserializerModifier

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.List, tools.jackson.databind.*, tools.jackson.databind.deser.bean.BeanDeserializer, tools.jackson.databind.introspect.BeanPropertyDefinition, tools.jackson.databind.type.ArrayType, .CollectionLikeType, .CollectionType, .MapLikeType, .MapType, .ReferenceType

Abstract class that defines API for objects that can be registered (via ObjectMapper configuration process, using tools.jackson.databind.cfg.MapperBuilder) to participate in constructing ValueDeserializer instances (including but not limited to BeanDeserializers). This is typically done by modules that want alter some aspects of the typical serialization process.

Sequence in which callback methods are called for a BeanDeserializer is:

  1. updateProperties is called once all property definitions are collected, and initial filtering (by ignorable type and explicit ignoral-by-bean) has been performed.
  2. updateBuilder is called once all initial pieces for building deserializer have been collected
  3. modifyDeserializer is called after deserializer has been built by BeanDeserializerBuilder but before it is returned to be used

For other types of deserializers, methods called depend on type of values for which deserializer is being constructed; and only a single method is called since the process does not involve builders (unlike that of BeanDeserializer.

Default method implementations are "no-op"s, meaning that methods are implemented but have no effect; this is mostly so that new methods can be added in later versions.

Note

In Jackson 2.x was named BeanDeserializerModifier

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ValueDeserializer<?>

Returns:

Deserializer to use; either deserializer that was passed in, or an instance method constructed.
modifyArrayDeserializer
(DeserializationConfig
Configuration in use
config
,
ArrayType
Type of the value deserializer is used for.
valueType
,
BeanDescription.Supplier
Description of the type to deserialize
beanDescRef
,
ValueDeserializer<?>
Default deserializer that would be used.
deserializer
)

Method called by DeserializerFactory after it has constructed the standard deserializer for given ArrayType to make it possible to either replace or augment this deserializer with additional functionality.

public ValueDeserializer<?>
modifyCollectionDeserializer(DeserializationConfig config, CollectionType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default CollectionType deserializer instance.

public ValueDeserializer<?>
modifyCollectionLikeDeserializer(DeserializationConfig config, CollectionLikeType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default CollectionLikeType deserializer instance.

public ValueDeserializer<?>
modifyDeserializer(DeserializationConfig config, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default bean deserializer instance with properties collected and ordered earlier.

public ValueDeserializer<?>
modifyEnumDeserializer(DeserializationConfig config, JavaType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default enum type deserializer instance.

public KeyDeserializer
modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deserializer)

Method called by DeserializerFactory after it has constructed the standard key deserializer for given key type.

public ValueDeserializer<?>
modifyMapDeserializer(DeserializationConfig config, MapType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default MapType deserializer instance.

public ValueDeserializer<?>
modifyMapLikeDeserializer(DeserializationConfig config, MapLikeType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default MapLikeType deserializer instance.

public ValueDeserializer<?>
modifyReferenceDeserializer(DeserializationConfig config, ReferenceType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default ReferenceType deserializer instance.

public BeanDeserializerBuilder
updateBuilder(DeserializationConfig config, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder)

Method called by BeanDeserializerFactory when it has collected basic information such as tentative list of properties to deserialize.

public List<BeanPropertyDefinition>
updateProperties(DeserializationConfig config, BeanDescription.Supplier beanDescRef, List<BeanPropertyDefinition> propDefs)

Method called by BeanDeserializerFactory when it has collected initial list of BeanPropertyDefinitions, and done basic by-name and by-type filtering, but before constructing builder or actual property handlers; or arranging order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ValueDeserializerModifierback to summary
public ValueDeserializerModifier()

Method Detail

modifyArrayDeserializerback to summary
public ValueDeserializer<?> modifyArrayDeserializer(DeserializationConfig config, ArrayType valueType, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by DeserializerFactory after it has constructed the standard deserializer for given ArrayType to make it possible to either replace or augment this deserializer with additional functionality.

Parameters
config:DeserializationConfig

Configuration in use

valueType:ArrayType

Type of the value deserializer is used for.

beanDescRef:BeanDescription.Supplier

Description of the type to deserialize

deserializer:ValueDeserializer<?>

Default deserializer that would be used.

Returns:ValueDeserializer<?>

Deserializer to use; either deserializer that was passed in, or an instance method constructed.

modifyCollectionDeserializerback to summary
public ValueDeserializer<?> modifyCollectionDeserializer(DeserializationConfig config, CollectionType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default CollectionType deserializer instance.

modifyCollectionLikeDeserializerback to summary
public ValueDeserializer<?> modifyCollectionLikeDeserializer(DeserializationConfig config, CollectionLikeType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default CollectionLikeType deserializer instance.

modifyDeserializerback to summary
public ValueDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default bean deserializer instance with properties collected and ordered earlier. Implementations can modify or replace given deserializer and return deserializer to use. Note that although initial deserializer being passed is usually of type BeanDeserializer, modifiers may return deserializers of other types; and this is why implementations must check for type before casting.

Since 2.10 this is also called for custom deserializers for types not deemed to be of any more specific (reference, enum, array, collection(-like), map(-like), node type)

modifyEnumDeserializerback to summary
public ValueDeserializer<?> modifyEnumDeserializer(DeserializationConfig config, JavaType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default enum type deserializer instance.

modifyKeyDeserializerback to summary
public KeyDeserializer modifyKeyDeserializer(DeserializationConfig config, JavaType type, KeyDeserializer deserializer)

Method called by DeserializerFactory after it has constructed the standard key deserializer for given key type. This make it possible to replace the default key deserializer, or augment it somehow (including optional use of default deserializer with occasional override).

modifyMapDeserializerback to summary
public ValueDeserializer<?> modifyMapDeserializer(DeserializationConfig config, MapType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default MapType deserializer instance.

modifyMapLikeDeserializerback to summary
public ValueDeserializer<?> modifyMapLikeDeserializer(DeserializationConfig config, MapLikeType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default MapLikeType deserializer instance.

modifyReferenceDeserializerback to summary
public ValueDeserializer<?> modifyReferenceDeserializer(DeserializationConfig config, ReferenceType type, BeanDescription.Supplier beanDescRef, ValueDeserializer<?> deserializer)

Method called by BeanDeserializerFactory after constructing default ReferenceType deserializer instance.

updateBuilderback to summary
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BeanDescription.Supplier beanDescRef, BeanDeserializerBuilder builder)

Method called by BeanDeserializerFactory when it has collected basic information such as tentative list of properties to deserialize. Implementations may choose to modify state of builder (to affect deserializer being built), or even completely replace it (if they want to build different kind of deserializer). Typically changes mostly concern set of properties to deserialize.

updatePropertiesback to summary
public List<BeanPropertyDefinition> updateProperties(DeserializationConfig config, BeanDescription.Supplier beanDescRef, List<BeanPropertyDefinition> propDefs)

Method called by BeanDeserializerFactory when it has collected initial list of BeanPropertyDefinitions, and done basic by-name and by-type filtering, but before constructing builder or actual property handlers; or arranging order. The most common changes to make at this point are to completely remove specified properties, or rename then: other modifications are easier to make at later points.