Class BeanDeserializerModifier

java.lang.Object
org.codehaus.jackson.map.deser.BeanDeserializerModifier

public abstract class BeanDeserializerModifier extends Object
Abstract class that defines API for objects that can be registered (for 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:

  • updateBuilder is called once all initial pieces for building deserializer have been collected
  • 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.

    Since:
    1.7
    • Constructor Details

      • BeanDeserializerModifier

        public BeanDeserializerModifier()
    • Method Details

      • updateBuilder

        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.
      • modifyDeserializer

        public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BasicBeanDescription beanDesc, JsonDeserializer<?> 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 of type BeanDeserializer, modifiers may return deserializers of other types; and this is why implementations must check for type before casting.