com.fasterxml.jackson.databind.ser

Class BeanSerializerBuilder



  • public class BeanSerializerBuilder
    extends Object
    Builder class used for aggregating deserialization information about a POJO, in order to build a JsonSerializer for serializing intances. Main reason for using separate builder class is that this makes it easier to make actual serializer class fully immutable.
    • Field Detail

      • _filteredProperties

        protected BeanPropertyWriter[] _filteredProperties
        Optional array of filtered property writers; if null, no view-based filtering is performed.
      • _anyGetter

        protected AnyGetterWriter _anyGetter
        Writer used for "any getter" properties, if any.
      • _filterId

        protected Object _filterId
        Id of the property filter to use for POJO, if any.
      • _typeId

        protected AnnotatedMember _typeId
        Property that is used for type id (and not serialized as regular property)
      • _objectIdWriter

        protected ObjectIdWriter _objectIdWriter
        Object responsible for serializing Object Ids for the handled type, if any.
    • Constructor Detail

      • BeanSerializerBuilder

        public BeanSerializerBuilder(BeanDescription beanDesc)
      • BeanSerializerBuilder

        protected BeanSerializerBuilder(BeanSerializerBuilder src)
        Copy-constructor that may be used for sub-classing
    • Method Detail

      • setConfig

        protected void setConfig(SerializationConfig config)
        Initialization method called right after construction, to specify configuration to use.

        Note: ideally should be passed in constructor, but for backwards compatibility, needed to add a setter instead

        Since:
        2.1
      • setFilteredProperties

        public void setFilteredProperties(BeanPropertyWriter[] properties)
      • setFilterId

        public void setFilterId(Object filterId)
      • setObjectIdWriter

        public void setObjectIdWriter(ObjectIdWriter w)
      • hasProperties

        public boolean hasProperties()
      • getFilterId

        public Object getFilterId()
      • build

        public JsonSerializer<?> build()
        Method called to create BeanSerializer instance with all accumulated information. Will construct a serializer if we have enough information, or return null if not.
      • createDummy

        public BeanSerializer createDummy()
        Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)

Copyright © 2008–2018 FasterXML. All rights reserved.