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

public final Class PropertyBasedCreator

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.*, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.SettableBeanProperty, .ValueInstantiator

Object that is used to collect arguments for non-default creator (non-default-constructor, or argument-taking factory method) before creator can be called. Since ordering of JSON properties is not guaranteed, this may require buffering of values other than ones being passed to creator.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
PropertyBasedCreator.CaseInsensitiveMap

Simple override of standard java.util.HashMap to support case-insensitive access to creator properties

Field Summary

Modifier and TypeField and Description
protected final SettableBeanProperty[]
_allProperties

Array that contains properties that expect value to inject, if any; null if no injectable values are expected.

protected final int
_propertyCount

Number of properties: usually same as size of _propertyLookup, but not necessarily, when we have unnamed injectable properties.

protected final HashMap<String, SettableBeanProperty>
_propertyLookup

Map that contains property objects for either constructor or factory method (whichever one is null: one property for each parameter for that one), keyed by logical property name

protected final ValueInstantiator
_valueInstantiator

Helper object that knows how to actually construct the instance by invoking creator method with buffered arguments.

Constructor Summary

AccessConstructor and Description
protected
PropertyBasedCreator(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, boolean caseInsensitive, boolean addAliases)

Method Summary

Modifier and TypeMethod and Description
public Object
public static PropertyBasedCreator
construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, BeanPropertyMap allProperties)

Factory method used for building actual instances to be used with POJOS: resolves deserializers, checks for "null values".

public static PropertyBasedCreator
construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, boolean caseInsensitive)

Factory method used for building actual instances to be used with types OTHER than POJOs.

public static PropertyBasedCreator
construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps)

Deprecated
public SettableBeanProperty
public SettableBeanProperty
findCreatorProperty(int propertyIndex)

public Collection<SettableBeanProperty>
public PropertyValueBuffer
startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir)

Method called when starting to build a bean instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_allPropertiesback to summary
protected final SettableBeanProperty[] _allProperties

Array that contains properties that expect value to inject, if any; null if no injectable values are expected.

_propertyCountback to summary
protected final int _propertyCount

Number of properties: usually same as size of _propertyLookup, but not necessarily, when we have unnamed injectable properties.

_propertyLookupback to summary
protected final HashMap<String, SettableBeanProperty> _propertyLookup

Map that contains property objects for either constructor or factory method (whichever one is null: one property for each parameter for that one), keyed by logical property name

_valueInstantiatorback to summary
protected final ValueInstantiator _valueInstantiator

Helper object that knows how to actually construct the instance by invoking creator method with buffered arguments.

Constructor Detail

PropertyBasedCreatorback to summary
protected PropertyBasedCreator(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, boolean caseInsensitive, boolean addAliases)

Method Detail

buildback to summary
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws IOException
constructback to summary
public static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, BeanPropertyMap allProperties) throws JsonMappingException

Factory method used for building actual instances to be used with POJOS: resolves deserializers, checks for "null values".

Since
2.9
constructback to summary
public static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, boolean caseInsensitive) throws JsonMappingException

Factory method used for building actual instances to be used with types OTHER than POJOs. resolves deserializers and checks for "null values".

Since
2.9
constructback to summary
public static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps) throws JsonMappingException

Deprecated

Annotations
@Deprecated
findCreatorPropertyback to summary
public SettableBeanProperty findCreatorProperty(String name)
findCreatorPropertyback to summary
public SettableBeanProperty findCreatorProperty(int propertyIndex)
propertiesback to summary
public Collection<SettableBeanProperty> properties()
startBuildingback to summary
public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir)

Method called when starting to build a bean instance.

Since
2.1 (added ObjectIdReader parameter -- existed in previous versions without)
com.fasterxml.jackson.databind.deser.impl back to summary

pack-priv Class PropertyBasedCreator.CaseInsensitiveMap

extends HashMap<String, SettableBeanProperty>
Class Inheritance

Simple override of standard java.util.HashMap to support case-insensitive access to creator properties
Since
2.8.5

Field Summary

Modifier and TypeField and Description
protected final Locale
_locale

Lower-casing can have Locale-specific minor variations.

private static final long

Constructor Summary

AccessConstructor and Description
public
CaseInsensitiveMap()

Deprecated
public

Method Summary

Modifier and TypeMethod and Description
public static PropertyBasedCreator.CaseInsensitiveMap
public SettableBeanProperty
get(Object
the key whose associated value is to be returned
key0
)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public SettableBeanProperty
put(String
key with which the specified value is to be associated
key
,
SettableBeanProperty
value to be associated with the specified key
value
)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Associates the specified value with the specified key in this map.
Inherited from java.util.HashMap:
clearclonecomputecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValueentrySetforEachgetOrDefaultisEmptykeySetmergenewHashMapputAllputIfAbsentremoveremovereplacereplacereplaceAllsizevalues

Field Detail

_localeback to summary
protected final Locale _locale

Lower-casing can have Locale-specific minor variations.

Since
2.11
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.HashMap.serialVersionUID.

Constructor Detail

CaseInsensitiveMapback to summary
public CaseInsensitiveMap()

Deprecated

Annotations
@Deprecated
CaseInsensitiveMapback to summary
public CaseInsensitiveMap(Locale l)

Method Detail

constructback to summary
public static PropertyBasedCreator.CaseInsensitiveMap construct(Locale l)
getback to summary
public SettableBeanProperty get(Object key0)

Overrides java.util.HashMap.get.

Implements java.util.Map.get.

Doc from java.util.HashMap.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null. The containsKey operation may be used to distinguish these two cases.

Parameters
key0:Object

Doc from java.util.Map.get.

the key whose associated value is to be returned

Returns:SettableBeanProperty

Doc from java.util.Map.get.

the value to which the specified key is mapped, or null if this map contains no mapping for the key

Annotations
@Override
putback to summary
public SettableBeanProperty put(String key, SettableBeanProperty value)

Overrides java.util.HashMap.put.

Implements java.util.Map.put.

Doc from java.util.HashMap.put.

Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.

Parameters
key:String

key with which the specified value is to be associated

value:SettableBeanProperty

value to be associated with the specified key

Returns:SettableBeanProperty

the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)

Annotations
@Override