com.fasterxml.jackson.databind.deser.impl

## Class PropertyBasedCreator

- java.lang.Object
- - com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator

    public final class PropertyBasedCreator
    extends Object

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

Fields
`protected SettableBeanProperty[]` `_allProperties` Array of all Creator properties (based on arguments to constructor or factory method).
`protected BitSet` `_injectablePropIndexes` Indexes of properties with associated Injectable values, if any: `null` if none.
`protected int` `_propertyCount` Number of properties: usually same as size of `_propertyLookup`, but not necessarily, when we have unnamed injectable properties.
`protected 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 ValueInstantiator` `_valueInstantiator` Helper object that knows how to actually construct the instance by invoking creator method with buffered arguments.

### Constructor Summary

Constructors
`protected` `PropertyBasedCreator(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, boolean caseInsensitive, boolean addAliases)`
`protected` `PropertyBasedCreator(PropertyBasedCreator base, HashMap<String,SettableBeanProperty> propertyLookup, SettableBeanProperty[] allProperties)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`Object` `build(DeserializationContext ctxt, PropertyValueBuffer buffer)`
`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".
`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.
`SettableBeanProperty` `findCreatorProperty(int propertyIndex)`
`SettableBeanProperty` `findCreatorProperty(String name)`
`Collection<SettableBeanProperty>` `properties()`
`PropertyBasedCreator` `renameAll(NameTransformer transformer)` Mutant factory method for constructing a map where the names of all properties are transformed using the given `NameTransformer`.
`PropertyValueBuffer` `startBuilding(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt, ObjectIdReader oir)` Method called when starting to build a bean instance.
`PropertyValueBuffer` `startBuildingWithAnySetter(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt, ObjectIdReader oir, SettableAnyProperty anySetter)` Method called when starting to build a bean instance.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _propertyCount

    protected final int _propertyCount

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

#### _valueInstantiator

    protected final ValueInstantiator _valueInstantiator

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

#### _propertyLookup

    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

#### _allProperties

    protected final SettableBeanProperty[] _allProperties

Array of all Creator properties (based on arguments to constructor or factory method).

#### _injectablePropIndexes

    protected final BitSet _injectablePropIndexes

Indexes of properties with associated Injectable values, if any: `null` if none.

Since:
  2.21

### Constructor Detail

#### PropertyBasedCreator

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

#### PropertyBasedCreator

    protected PropertyBasedCreator(PropertyBasedCreator base,
                                   HashMap<String,SettableBeanProperty> propertyLookup,
                                   SettableBeanProperty[] allProperties)

Since:
  2.19

### Method Detail

#### construct

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

Throws:
  `JsonMappingException`
Since:
  2.9

#### construct

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

Throws:
  `JsonMappingException`
Since:
  2.9

#### renameAll

    public PropertyBasedCreator renameAll(NameTransformer transformer)

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

Since:
  2.19

#### properties

    public Collection<SettableBeanProperty> properties()

#### findCreatorProperty

    public SettableBeanProperty findCreatorProperty(String name)

#### findCreatorProperty

    public SettableBeanProperty findCreatorProperty(int propertyIndex)

#### startBuilding

    public PropertyValueBuffer startBuilding(com.fasterxml.jackson.core.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)

#### startBuildingWithAnySetter

    public PropertyValueBuffer startBuildingWithAnySetter(com.fasterxml.jackson.core.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 IOException

Throws:
  `IOException`