Class BeanDeserializerBuilder


  • public class BeanDeserializerBuilder
    extends java.lang.Object
    Builder class used for aggregating deserialization information about a POJO, in order to build a JsonDeserializer for deserializing instances.
    • Field Detail

      • _beanDesc

        protected final BeanDescription _beanDesc
        Introspected information about POJO for deserializer to handle
      • _properties

        protected final java.util.Map<java.lang.String,​SettableBeanProperty> _properties
        Properties to deserialize collected so far.
      • _injectables

        protected java.util.List<ValueInjector> _injectables
        Value injectors for deserialization
      • _backRefProperties

        protected java.util.HashMap<java.lang.String,​SettableBeanProperty> _backRefProperties
        Back-reference properties this bean contains (if any)
      • _ignorableProps

        protected java.util.HashSet<java.lang.String> _ignorableProps
        Set of names of properties that are recognized but are to be ignored for deserialization purposes (meaning no exception is thrown, value is just skipped).
      • _includableProps

        protected java.util.HashSet<java.lang.String> _includableProps
        Set of names of properties that are recognized and are set to be included for deserialization purposes (null deactivate this, empty includes nothing).
      • _valueInstantiator

        protected ValueInstantiator _valueInstantiator
        Object that will handle value instantiation for the bean type.
      • _objectIdReader

        protected ObjectIdReader _objectIdReader
        Handler for Object Id values, if Object Ids are enabled for the bean type.
      • _anySetter

        protected SettableAnyProperty _anySetter
        Fallback setter used for handling any properties that are not mapped to regular setters. If setter is not null, it will be called once for each such property.
      • _ignoreAllUnknown

        protected boolean _ignoreAllUnknown
        Flag that can be set to ignore and skip unknown properties. If set, will not throw an exception for unknown properties.
      • _buildMethod

        protected AnnotatedMethod _buildMethod
        When creating Builder-based deserializers, this indicates method to call on builder to finalize value.
      • _builderConfig

        protected JsonPOJOBuilder.Value _builderConfig
        In addition, Builder may have additional configuration
    • Method Detail

      • addOrReplaceProperty

        public void addOrReplaceProperty​(SettableBeanProperty prop,
                                         boolean allowOverride)
        Method for adding a new property or replacing a property.
      • addProperty

        public void addProperty​(SettableBeanProperty prop)
        Method to add a property setter. Will ensure that there is no unexpected override; if one is found will throw a IllegalArgumentException.
      • addBackReferenceProperty

        public void addBackReferenceProperty​(java.lang.String referenceName,
                                             SettableBeanProperty prop)
        Method called to add a property that represents so-called back reference; reference that "points back" to object that has forward reference to currently built bean.
      • addIgnorable

        public void addIgnorable​(java.lang.String propName)
        Method that will add property name as one of properties that can be ignored if not recognized.
      • addIncludable

        public void addIncludable​(java.lang.String propName)
        Method that will add property name as one of the properties that will be included.
        Since:
        2.12
      • addCreatorProperty

        public void addCreatorProperty​(SettableBeanProperty prop)
        Method called by deserializer factory, when a "creator property" (something that is passed via constructor- or factory method argument; instead of setter or field).

        Default implementation does not do anything; we may need to revisit this decision if these properties need to be available through accessors. For now, however, we just have to ensure that we don't try to resolve types that masked setter/field has (see [JACKSON-700] for details).

      • setIgnoreUnknownProperties

        public void setIgnoreUnknownProperties​(boolean ignore)
      • setValueInstantiator

        public void setValueInstantiator​(ValueInstantiator inst)
      • setObjectIdReader

        public void setObjectIdReader​(ObjectIdReader r)
      • getProperties

        public java.util.Iterator<SettableBeanProperty> getProperties()
        Method that allows accessing all properties that this builder currently contains.

        Note that properties are returned in order that properties are ordered (explictly, or by rule), which is the serialization order.

      • hasProperty

        public boolean hasProperty​(PropertyName propertyName)
      • getInjectables

        public java.util.List<ValueInjector> getInjectables()
      • hasIgnorable

        public boolean hasIgnorable​(java.lang.String name)
        Since:
        2.9.4
      • buildAbstract

        public AbstractDeserializer buildAbstract()
        Alternate build method used when we must be using some form of abstract resolution, usually by using addition Type Id ("polymorphic deserialization")
        Since:
        2.0
      • createBuilderBasedDeserializer

        protected JsonDeserializer<?> createBuilderBasedDeserializer​(JavaType valueType,
                                                                     BeanPropertyMap propertyMap,
                                                                     boolean anyViews)
        Extension point for overriding the actual creation of the builder deserializer.
        Since:
        2.11
      • _collectAliases

        protected java.util.Map<java.lang.String,​java.util.List<PropertyName>> _collectAliases​(java.util.Collection<SettableBeanProperty> props)
      • _findCaseInsensitivity

        protected boolean _findCaseInsensitivity()