public abstract class BeanDeserializerModifier extends Object
BeanDeserializerFactory
to participate in constructing BeanDeserializer
instances.
This is typically done by modules that want alter some aspects of deserialization
process; and is preferable to sub-classing of BeanDeserializerFactory
.
Sequence in which callback methods are called is as follows:
modifyDeserializer
is called after deserializer has been built
by BeanDeserializerBuilder
but before it is returned to be used
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.
Constructor and Description |
---|
BeanDeserializerModifier() |
Modifier and Type | Method and Description |
---|---|
JsonDeserializer<?> |
modifyDeserializer(DeserializationConfig config,
BasicBeanDescription beanDesc,
JsonDeserializer<?> deserializer)
Method called by
BeanDeserializerFactory after constructing default
bean deserializer instance with properties collected and ordered earlier. |
BeanDeserializerBuilder |
updateBuilder(DeserializationConfig config,
BasicBeanDescription beanDesc,
BeanDeserializerBuilder builder)
Method called by
BeanDeserializerFactory when it has collected
basic information such as tentative list of properties to deserialize. |
public BeanDeserializerBuilder updateBuilder(DeserializationConfig config, BasicBeanDescription beanDesc, BeanDeserializerBuilder builder)
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.public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BasicBeanDescription beanDesc, JsonDeserializer<?> deserializer)
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 of type
BeanDeserializer
, modifiers may return deserializers of other types;
and this is why implementations must check for type before casting.