com.fasterxml.jackson.databind.deser.impl
Class PropertyBasedCreator

java.lang.Object
  extended by 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
protected  Object[] _defaultValues
          If some property values must always have a non-null value (like primitive types do), this array contains such default values.
protected  HashMap<String,SettableBeanProperty> _properties
          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  SettableBeanProperty[] _propertiesWithInjectables
          Array that contains properties that expect value to inject, if any; null if no injectable values are expected.
protected  ValueInstantiator _valueInstantiator
           
 
Constructor Summary
protected PropertyBasedCreator(ValueInstantiator valueInstantiator, SettableBeanProperty[] creatorProps, Object[] defaultValues)
           
 
Method Summary
 void assignDeserializer(SettableBeanProperty prop, JsonDeserializer<Object> deser)
           
 Object build(DeserializationContext ctxt, PropertyValueBuffer buffer)
           
static PropertyBasedCreator construct(DeserializationContext ctxt, ValueInstantiator valueInstantiator, SettableBeanProperty[] srcProps)
          Factory method used for building actual instances: resolves deserializers and checks for "null values".
 SettableBeanProperty findCreatorProperty(String name)
           
 Collection<SettableBeanProperty> properties()
           
 PropertyValueBuffer startBuilding(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt)
          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

_valueInstantiator

protected final ValueInstantiator _valueInstantiator

_properties

protected final HashMap<String,SettableBeanProperty> _properties
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


_defaultValues

protected final Object[] _defaultValues
If some property values must always have a non-null value (like primitive types do), this array contains such default values.


_propertiesWithInjectables

protected final SettableBeanProperty[] _propertiesWithInjectables
Array that contains properties that expect value to inject, if any; null if no injectable values are expected.

Constructor Detail

PropertyBasedCreator

protected PropertyBasedCreator(ValueInstantiator valueInstantiator,
                               SettableBeanProperty[] creatorProps,
                               Object[] defaultValues)
Method Detail

construct

public static PropertyBasedCreator construct(DeserializationContext ctxt,
                                             ValueInstantiator valueInstantiator,
                                             SettableBeanProperty[] srcProps)
                                      throws JsonMappingException
Factory method used for building actual instances: resolves deserializers and checks for "null values".

Throws:
JsonMappingException

assignDeserializer

public void assignDeserializer(SettableBeanProperty prop,
                               JsonDeserializer<Object> deser)

properties

public Collection<SettableBeanProperty> properties()

findCreatorProperty

public SettableBeanProperty findCreatorProperty(String name)

startBuilding

public PropertyValueBuffer startBuilding(com.fasterxml.jackson.core.JsonParser jp,
                                         DeserializationContext ctxt)
Method called when starting to build a bean instance.


build

public Object build(DeserializationContext ctxt,
                    PropertyValueBuffer buffer)
             throws IOException
Throws:
IOException


Copyright © 2012 fasterxml.com. All Rights Reserved.