Top Description Inners Fields Constructors Methods
tools.jackson.databind.deser.bean

public final Class PropertyBasedCreator

extends Object
Class Inheritance
Imports
java.util.*, tools.jackson.core.JacksonException, .JsonParser, tools.jackson.databind.*, tools.jackson.databind.deser.SettableAnyProperty, .SettableBeanProperty, .ValueInstantiator, tools.jackson.databind.deser.impl.ObjectIdReader, tools.jackson.databind.util.NameTransformer

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[]
_propertiesInOrder

Array that contains properties that match creator properties

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)

protected

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 SettableBeanProperty
public SettableBeanProperty
findCreatorProperty(int propertyIndex)

public Collection<SettableBeanProperty>
public PropertyBasedCreator
renameAll(DeserializationContext ctxt, NameTransformer transformer)

Mutant factory method for constructing a map where the names of all properties are transformed using the given NameTransformer.

public PropertyValueBuffer
startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir)

Method called when starting to build a bean instance.

public PropertyValueBuffer
startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter)

Method called when starting to build a bean instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_propertiesInOrderback to summary
protected final SettableBeanProperty[] _propertiesInOrder

Array that contains properties that match creator properties

_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)
PropertyBasedCreatorback to summary
protected PropertyBasedCreator(PropertyBasedCreator base, HashMap<String, SettableBeanProperty> propertyLookup, SettableBeanProperty[] allProperties)
Since
2.19

Method Detail

buildback to summary
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws JacksonException
constructback to summary
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".

constructback to summary
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. resolves deserializers and checks for "null values".

findCreatorPropertyback to summary
public SettableBeanProperty findCreatorProperty(String name)
findCreatorPropertyback to summary
public SettableBeanProperty findCreatorProperty(int propertyIndex)
propertiesback to summary
public Collection<SettableBeanProperty> properties()
renameAllback to summary
public PropertyBasedCreator renameAll(DeserializationContext ctxt, NameTransformer transformer)

Mutant factory method for constructing a map where the names of all properties are transformed using the given NameTransformer.

Since
2.19
startBuildingback to summary
public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir)

Method called when starting to build a bean instance.

startBuildingWithAnySetterback to summary
public PropertyValueBuffer startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter)

Method called when starting to build a bean instance.

Since
2.18 (added SettableAnyProperty parameter)
tools.jackson.databind.deser.bean 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

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

Method Summary

Modifier and TypeMethod and Description
public static PropertyBasedCreator.CaseInsensitiveMap
public SettableBeanProperty
get(Object 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, SettableBeanProperty 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.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.HashMap.serialVersionUID.

Constructor Detail

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.

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.

Annotations
@Override