java.lang.Object
tools.jackson.databind.deser.bean.PropertyBasedCreator
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BitSetIndexes of properties with associated Injectable values, if any:nullif none.protected final SettableBeanProperty[]Array that contains properties that match creator propertiesprotected final intNumber of properties: usually same as size of_propertyLookup, but not necessarily, when we have unnamed injectable properties.protected final HashMap<String,SettableBeanProperty> 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 nameprotected final ValueInstantiatorHelper object that knows how to actually construct the instance by invoking creator method with buffered arguments. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPropertyBasedCreator(PropertyBasedCreator base, HashMap<String, SettableBeanProperty> propertyLookup, SettableBeanProperty[] allProperties) protectedPropertyBasedCreator(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, boolean caseInsensitive, boolean addAliases) -
Method Summary
Modifier and TypeMethodDescriptionbuild(DeserializationContext ctxt, PropertyValueBuffer buffer) static PropertyBasedCreatorconstruct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcCreatorProps, boolean caseInsensitive) Factory method used for building actual instances to be used with types OTHER than POJOs.static PropertyBasedCreatorconstruct(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".findCreatorProperty(int propertyIndex) findCreatorProperty(String name) renameAll(DeserializationContext ctxt, NameTransformer transformer) Mutant factory method for constructing a map where the names of all properties are transformed using the givenNameTransformer.startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir) Method called when starting to build a bean instance.startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter) Method called when starting to build a bean instance.
-
Field Details
-
_propertyCount
protected final int _propertyCountNumber of properties: usually same as size of_propertyLookup, but not necessarily, when we have unnamed injectable properties. -
_valueInstantiator
Helper object that knows how to actually construct the instance by invoking creator method with buffered arguments. -
_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 -
_propertiesInOrder
Array that contains properties that match creator properties -
_injectablePropIndexes
Indexes of properties with associated Injectable values, if any:nullif none.- Since:
- 2.21
-
-
Constructor Details
-
PropertyBasedCreator
protected PropertyBasedCreator(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, boolean caseInsensitive, boolean addAliases) -
PropertyBasedCreator
protected PropertyBasedCreator(PropertyBasedCreator base, HashMap<String, SettableBeanProperty> propertyLookup, SettableBeanProperty[] allProperties)
-
-
Method Details
-
construct
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". -
construct
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". -
renameAll
Mutant factory method for constructing a map where the names of all properties are transformed using the givenNameTransformer.- Since:
- 2.19
-
properties
-
findCreatorProperty
-
findCreatorProperty
-
startBuilding
public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir) Method called when starting to build a bean instance. -
startBuildingWithAnySetter
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)
-
build
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws JacksonException - Throws:
JacksonException
-