Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.deser

public Class BeanDeserializerBuilder

extends Object
Class Inheritance
Imports
java.util.*, com.fasterxml.jackson.annotation.JsonFormat, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder, com.fasterxml.jackson.databind.deser.impl.BeanPropertyMap, .ObjectIdValueProperty, .ObjectIdReader, .ValueInjector, com.fasterxml.jackson.databind.introspect.*, com.fasterxml.jackson.databind.util.Annotations, .ClassUtil, .IgnorePropertiesUtil

Builder class used for aggregating deserialization information about a POJO, in order to build a JsonDeserializer for deserializing instances.

Field Summary

Modifier and TypeField and Description
protected SettableAnyProperty
_anySetter

Fallback setter used for handling any properties that are not mapped to regular setters.

protected HashMap<String, SettableBeanProperty>
_backRefProperties

Back-reference properties this bean contains (if any)

protected final BeanDescription
_beanDesc

Introspected information about POJO for deserializer to handle

protected JsonPOJOBuilder.Value
_builderConfig

In addition, Builder may have additional configuration

protected AnnotatedMethod
_buildMethod

When creating Builder-based deserializers, this indicates method to call on builder to finalize value.

protected final DeserializationConfig
protected final DeserializationContext
protected HashSet<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).

protected boolean
_ignoreAllUnknown

Flag that can be set to ignore and skip unknown properties.

protected HashSet<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).

protected List<ValueInjector>
_injectables

Value injectors for deserialization

protected ObjectIdReader
_objectIdReader

Handler for Object Id values, if Object Ids are enabled for the bean type.

protected final Map<String, SettableBeanProperty>
_properties

Properties to deserialize collected so far.

protected ValueInstantiator
_valueInstantiator

Object that will handle value instantiation for the bean type.

Constructor Summary

AccessConstructor and Description
public
protected
BeanDeserializerBuilder(BeanDeserializerBuilder src)

Copy constructor for sub-classes to use, when constructing custom builder instances

Method Summary

Modifier and TypeMethod and Description
protected Map<String, List<PropertyName>>
private static HashMap<String, SettableBeanProperty>
private static <T> List<T>
_copy(List<T> src)

protected boolean
protected void
protected void
_handleBadAccess(IllegalArgumentException e0)

Helper method for linking root cause to "invalid type definition" exception; needed for troubleshooting issues with forcing access on later JDKs (as module definition boundaries are more strictly enforced).

public void
addBackReferenceProperty(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.

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).

public void
addIgnorable(String propName)

Method that will add property name as one of properties that can be ignored if not recognized.

public void
addIncludable(String propName)

Method that will add property name as one of the properties that will be included.

public void
addInjectable(PropertyName propName, JavaType propType, Annotations contextAnnotations, AnnotatedMember member, Object valueId)

public void
addOrReplaceProperty(SettableBeanProperty prop, boolean allowOverride)

Method for adding a new property or replacing a property.

public void
addProperty(SettableBeanProperty prop)

Method to add a property setter.

public JsonDeserializer<?>
build()

Method for constructing a BeanDeserializer, given all information collected.

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")

public JsonDeserializer<?>
buildBuilderBased(JavaType valueType, String expBuildMethodName)

Method for constructing a specialized deserializer that uses additional external Builder object during data binding.

protected JsonDeserializer<?>
createBuilderBasedDeserializer(JavaType valueType, BeanPropertyMap propertyMap, boolean anyViews)

Extension point for overriding the actual creation of the builder deserializer.

public SettableBeanProperty
findProperty(PropertyName propertyName)

public SettableAnyProperty
public JsonPOJOBuilder.Value
public AnnotatedMethod
public List<ValueInjector>
public ObjectIdReader
public Iterator<SettableBeanProperty>
getProperties()

Method that allows accessing all properties that this builder currently contains.

public ValueInstantiator
public boolean
public boolean
hasProperty(PropertyName propertyName)

public SettableBeanProperty
public void
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_anySetterback to summary
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.

_backRefPropertiesback to summary
protected HashMap<String, SettableBeanProperty> _backRefProperties

Back-reference properties this bean contains (if any)

_beanDescback to summary
protected final BeanDescription _beanDesc

Introspected information about POJO for deserializer to handle

_builderConfigback to summary
protected JsonPOJOBuilder.Value _builderConfig

In addition, Builder may have additional configuration

_buildMethodback to summary
protected AnnotatedMethod _buildMethod

When creating Builder-based deserializers, this indicates method to call on builder to finalize value.

_configback to summary
protected final DeserializationConfig _config
_contextback to summary
protected final DeserializationContext _context
Since
2.9
_ignorablePropsback to summary
protected HashSet<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).

_ignoreAllUnknownback to summary
protected boolean _ignoreAllUnknown

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

_includablePropsback to summary
protected HashSet<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).

_injectablesback to summary
protected List<ValueInjector> _injectables

Value injectors for deserialization

_objectIdReaderback to summary
protected ObjectIdReader _objectIdReader

Handler for Object Id values, if Object Ids are enabled for the bean type.

_propertiesback to summary
protected final Map<String, SettableBeanProperty> _properties

Properties to deserialize collected so far.

_valueInstantiatorback to summary
protected ValueInstantiator _valueInstantiator

Object that will handle value instantiation for the bean type.

Constructor Detail

BeanDeserializerBuilderback to summary
public BeanDeserializerBuilder(BeanDescription beanDesc, DeserializationContext ctxt)
BeanDeserializerBuilderback to summary
protected BeanDeserializerBuilder(BeanDeserializerBuilder src)

Copy constructor for sub-classes to use, when constructing custom builder instances

Method Detail

_collectAliasesback to summary
protected Map<String, List<PropertyName>> _collectAliases(Collection<SettableBeanProperty> props)
_copyback to summary
private static HashMap<String, SettableBeanProperty> _copy(HashMap<String, SettableBeanProperty> src)
_copyback to summary
private static <T> List<T> _copy(List<T> src)
_findCaseInsensitivityback to summary
protected boolean _findCaseInsensitivity()
_fixAccessback to summary
protected void _fixAccess(Collection<SettableBeanProperty> mainProps) throws JsonMappingException
_handleBadAccessback to summary
protected void _handleBadAccess(IllegalArgumentException e0) throws JsonMappingException

Helper method for linking root cause to "invalid type definition" exception; needed for troubleshooting issues with forcing access on later JDKs (as module definition boundaries are more strictly enforced).

Since
2.13.2
addBackReferencePropertyback to summary
public void addBackReferenceProperty(String referenceName, SettableBeanProperty prop) throws JsonMappingException

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.

addCreatorPropertyback to summary
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).

addIgnorableback to summary
public void addIgnorable(String propName)

Method that will add property name as one of properties that can be ignored if not recognized.

addIncludableback to summary
public void addIncludable(String propName)

Method that will add property name as one of the properties that will be included.

Since
2.12
addInjectableback to summary
public void addInjectable(PropertyName propName, JavaType propType, Annotations contextAnnotations, AnnotatedMember member, Object valueId) throws JsonMappingException
addOrReplacePropertyback to summary
public void addOrReplaceProperty(SettableBeanProperty prop, boolean allowOverride)

Method for adding a new property or replacing a property.

addPropertyback to summary
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.

buildback to summary
public JsonDeserializer<?> build() throws JsonMappingException

Method for constructing a BeanDeserializer, given all information collected.

buildAbstractback to summary
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
buildBuilderBasedback to summary
public JsonDeserializer<?> buildBuilderBased(JavaType valueType, String expBuildMethodName) throws JsonMappingException

Method for constructing a specialized deserializer that uses additional external Builder object during data binding.

createBuilderBasedDeserializerback to summary
protected JsonDeserializer<?> createBuilderBasedDeserializer(JavaType valueType, BeanPropertyMap propertyMap, boolean anyViews)

Extension point for overriding the actual creation of the builder deserializer.

Since
2.11
findPropertyback to summary
public SettableBeanProperty findProperty(PropertyName propertyName)
getAnySetterback to summary
public SettableAnyProperty getAnySetter()
getBuilderConfigback to summary
public JsonPOJOBuilder.Value getBuilderConfig()
getBuildMethodback to summary
public AnnotatedMethod getBuildMethod()
getInjectablesback to summary
public List<ValueInjector> getInjectables()
getObjectIdReaderback to summary
public ObjectIdReader getObjectIdReader()
getPropertiesback to summary
public 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.

getValueInstantiatorback to summary
public ValueInstantiator getValueInstantiator()
hasIgnorableback to summary
public boolean hasIgnorable(String name)
Since
2.9.4
hasPropertyback to summary
public boolean hasProperty(PropertyName propertyName)
removePropertyback to summary
public SettableBeanProperty removeProperty(PropertyName name)
setAnySetterback to summary
public void setAnySetter(SettableAnyProperty s)
setIgnoreUnknownPropertiesback to summary
public void setIgnoreUnknownProperties(boolean ignore)
setObjectIdReaderback to summary
public void setObjectIdReader(ObjectIdReader r)
setPOJOBuilderback to summary
public void setPOJOBuilder(AnnotatedMethod buildMethod, JsonPOJOBuilder.Value config)
setValueInstantiatorback to summary
public void setValueInstantiator(ValueInstantiator inst)