com.fasterxml.jackson.databind.ser

Class BeanSerializerModifier

    • Constructor Detail

      • BeanSerializerModifier

        public BeanSerializerModifier()
    • Method Detail

      • orderProperties

        public List<BeanPropertyWriter> orderProperties(SerializationConfig config,
                                               BeanDescription beanDesc,
                                               List<BeanPropertyWriter> beanProperties)
        Method called by BeanSerializerFactory with set of properties to serialize, in default ordering (based on defaults as well as possible type annotations). Implementations can change ordering any way they like. Properties List passed as argument is modifiable, and returned List must likewise be modifiable as it may be passed to multiple registered modifiers.
      • updateBuilder

        public BeanSerializerBuilder updateBuilder(SerializationConfig config,
                                          BeanDescription beanDesc,
                                          BeanSerializerBuilder builder)
        Method called by BeanSerializerFactory after collecting all information regarding POJO to serialize and updating builder with it, but before constructing serializer. Implementations may choose to modify state of builder (to affect serializer being built), or even completely replace it (if they want to build different kind of serializer). Typically, however, passed-in builder is returned, possibly with some modifications.
      • modifySerializer

        public JsonSerializer<?> modifySerializer(SerializationConfig config,
                                         BeanDescription beanDesc,
                                         JsonSerializer<?> serializer)
        Method called by BeanSerializerFactory after constructing default bean serializer instance with properties collected and ordered earlier. Implementations can modify or replace given serializer and return serializer to use. Note that although initial serializer being passed is of type BeanSerializer, modifiers may return serializers of other types; and this is why implementations must check for type before casting.

Copyright © 2012 FasterXML. All Rights Reserved.