Class ValueSerializerModifier

java.lang.Object
tools.jackson.databind.ser.ValueSerializerModifier
All Implemented Interfaces:
Serializable

public abstract class ValueSerializerModifier extends Object implements Serializable
Abstract class that defines API for objects that can be registered (via ObjectMapper configuration process, using MapperBuilder) to participate in constructing ValueSerializer instances (including but not limited to BeanSerializers). This is typically done by modules that want alter some aspects of the typical serialization process.

Sequence in which callback methods are called is as follows:

  1. After factory has collected tentative set of properties (instances of BeanPropertyWriter) is sent for modification via changeProperties(tools.jackson.databind.SerializationConfig, tools.jackson.databind.BeanDescription, java.util.List<tools.jackson.databind.ser.BeanPropertyWriter>). Changes can include removal, addition and replacement of suggested properties.
  2. Resulting set of properties are ordered (sorted) by factory, as per configuration, and then orderProperties(tools.jackson.databind.SerializationConfig, tools.jackson.databind.BeanDescription, java.util.List<tools.jackson.databind.ser.BeanPropertyWriter>) is called to allow modifiers to alter ordering.
  3. After all bean properties and related information is accumulated, updateBuilder(tools.jackson.databind.SerializationConfig, tools.jackson.databind.BeanDescription, tools.jackson.databind.ser.BeanSerializerBuilder) is called with builder, to allow builder state to be modified (including possibly replacing builder itself if necessary)
  4. Once all bean information has been determined, factory creates default BeanSerializer instance and passes it to modifiers using modifySerializer(tools.jackson.databind.SerializationConfig, tools.jackson.databind.BeanDescription, tools.jackson.databind.ValueSerializer<?>) (or type-specic alternative modifyXxxSerializer() method), for possible modification or replacement (by any ValueSerializer instance)

Default method implementations are "no-op"s, meaning that methods are implemented but have no effect.

NOTE: In Jackson 2.x was named BeanSerializerModifier

See Also: