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 booleanFlag indicating whether any creator properties are ManagedReferenceProperty instances, used to optimize deserialization by skipping back-reference injection when not needed.protected 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 TypeMethodDescriptionReturns all creator properties in creator-index order, including ones marked ignorable (whichproperties()excludes).build(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) booleanrenameAll(DeserializationContext ctxt, NameTransformer transformer) Mutant factory method for constructing a creator where property names are transformed using the givenNameTransformer.startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir) Deprecated.Since 3.2startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, boolean mayRebind) Method called when starting to build a bean instance.startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter) Deprecated.Since 3.2startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter, boolean mayRebind) 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. -
_hasManagedReferenceProperties
protected final boolean _hasManagedReferencePropertiesFlag indicating whether any creator properties are ManagedReferenceProperty instances, used to optimize deserialization by skipping back-reference injection when not needed.- Since:
- 3.1
-
-
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 creator where property names are transformed using the givenNameTransformer.NOTE: transformer is applied to property names only; value deserializers are left untouched. See
BeanPropertyMap.renameAll(tools.jackson.databind.DeserializationContext, tools.jackson.databind.util.NameTransformer)for rationale (see [databind#3178]).- Since:
- 2.19
-
properties
-
allPropertiesInOrder
Returns all creator properties in creator-index order, including ones marked ignorable (whichproperties()excludes).Returned array is shared internal state; callers must not mutate it.
- Since:
- 3.2
-
findCreatorProperty
-
findCreatorProperty
-
hasManagedReferenceProperties
public boolean hasManagedReferenceProperties()- Since:
- 3.1
-
startBuilding
@Deprecated public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir) Deprecated.Since 3.2Method called when starting to build a bean instance. -
startBuilding
public PropertyValueBuffer startBuilding(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, boolean mayRebind) Method called when starting to build a bean instance.The
mayRebindflag (added with [databind#5909]) signals that the constructed instance is a Builder that will be rebuilt viafinishBuild, so resolved Object Id Referrings need to be retained for later replay.- Since:
- 3.2
-
startBuildingWithAnySetter
@Deprecated public PropertyValueBuffer startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter) Deprecated.Since 3.2 -
startBuildingWithAnySetter
public PropertyValueBuffer startBuildingWithAnySetter(JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter, boolean mayRebind) Method called when starting to build a bean instance.See
startBuilding(JsonParser, DeserializationContext, ObjectIdReader, boolean)for the meaning ofmayRebind([databind#5909]).- Since:
- 3.2
-
build
public Object build(DeserializationContext ctxt, PropertyValueBuffer buffer) throws JacksonException - Throws:
JacksonException
-