|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.deser.ValueInstantiator com.fasterxml.jackson.databind.deser.std.StdValueInstantiator
public class StdValueInstantiator
Default ValueInstantiator
implementation, which supports
Creator methods that can be indicated by standard Jackson
annotations.
Field Summary | |
---|---|
protected boolean |
_cfgEmptyStringsAsObjects
Are we allowed to convert empty Strings to null objects? |
protected CreatorProperty[] |
_constructorArguments
|
protected AnnotatedWithParams |
_defaultCreator
Default (no-argument) constructor to use for instantiation (with createUsingDefault(com.fasterxml.jackson.databind.DeserializationContext) ) |
protected CreatorProperty[] |
_delegateArguments
|
protected AnnotatedWithParams |
_delegateCreator
|
protected JavaType |
_delegateType
|
protected AnnotatedWithParams |
_fromBooleanCreator
|
protected AnnotatedWithParams |
_fromDoubleCreator
|
protected AnnotatedWithParams |
_fromIntCreator
|
protected AnnotatedWithParams |
_fromLongCreator
|
protected AnnotatedWithParams |
_fromStringCreator
|
protected String |
_valueTypeDesc
Type of values that are instantiated; used for error reporting purposes. |
protected AnnotatedWithParams |
_withArgsCreator
|
Constructor Summary | |
---|---|
|
StdValueInstantiator(DeserializationConfig config,
Class<?> valueType)
|
|
StdValueInstantiator(DeserializationConfig config,
JavaType valueType)
|
protected |
StdValueInstantiator(StdValueInstantiator src)
Copy-constructor that sub-classes can use when creating new instances by fluent-style construction |
Method Summary | |
---|---|
protected Object |
_createFromStringFallbacks(DeserializationContext ctxt,
String value)
|
boolean |
canCreateFromBoolean()
Method that can be called to check whether a double (boolean / Boolean) based creator is available to use (to call ValueInstantiator.createFromDouble(com.fasterxml.jackson.databind.DeserializationContext, double) ). |
boolean |
canCreateFromDouble()
Method that can be called to check whether a double (double / Double) based creator is available to use (to call ValueInstantiator.createFromDouble(com.fasterxml.jackson.databind.DeserializationContext, double) ). |
boolean |
canCreateFromInt()
Method that can be called to check whether an integer (int, Integer) based creator is available to use (to call ValueInstantiator.createFromInt(com.fasterxml.jackson.databind.DeserializationContext, int) ). |
boolean |
canCreateFromLong()
Method that can be called to check whether a long (long, Long) based creator is available to use (to call ValueInstantiator.createFromLong(com.fasterxml.jackson.databind.DeserializationContext, long) ). |
boolean |
canCreateFromObjectWith()
Method that can be called to check whether a property-based creator (argument-taking constructor or factory method) is available to instantiate values from JSON Object |
boolean |
canCreateFromString()
Method that can be called to check whether a String-based creator is available for this instantiator |
boolean |
canCreateUsingDefault()
Method that can be called to check whether a default creator (constructor, or no-arg static factory method) is available for this instantiator |
boolean |
canCreateUsingDelegate()
Method that can be called to check whether a delegate-based creator (single-arg constructor or factory method) is available for this instantiator |
void |
configureFromBooleanCreator(AnnotatedWithParams creator)
|
void |
configureFromDoubleCreator(AnnotatedWithParams creator)
|
void |
configureFromIntCreator(AnnotatedWithParams creator)
|
void |
configureFromLongCreator(AnnotatedWithParams creator)
|
void |
configureFromObjectSettings(AnnotatedWithParams defaultCreator,
AnnotatedWithParams delegateCreator,
JavaType delegateType,
CreatorProperty[] delegateArgs,
AnnotatedWithParams withArgsCreator,
CreatorProperty[] constructorArgs)
Method for setting properties related to instantiating values from JSON Object. |
void |
configureFromStringCreator(AnnotatedWithParams creator)
|
Object |
createFromBoolean(DeserializationContext ctxt,
boolean value)
|
Object |
createFromDouble(DeserializationContext ctxt,
double value)
|
Object |
createFromInt(DeserializationContext ctxt,
int value)
|
Object |
createFromLong(DeserializationContext ctxt,
long value)
|
Object |
createFromObjectWith(DeserializationContext ctxt,
Object[] args)
Method called to create value instance from JSON Object when instantiation arguments are passed; this is done, for example when passing information specified with "Creator" annotations. |
Object |
createFromString(DeserializationContext ctxt,
String value)
|
Object |
createUsingDefault(DeserializationContext ctxt)
Method called to create value instance from a JSON value when no data needs to passed to creator (constructor, factory method); typically this will call the default constructor of the value object. |
Object |
createUsingDelegate(DeserializationContext ctxt,
Object delegate)
Method to called to create value instance from JSON Object using an intermediate "delegate" value to pass to createor method |
AnnotatedWithParams |
getDefaultCreator()
Method that can be called to try to access member (constructor, static factory method) that is used as the "default creator" (creator that is called without arguments; typically default [zero-argument] constructor of the type). |
AnnotatedWithParams |
getDelegateCreator()
Method that can be called to try to access member (constructor, static factory method) that is used as the "delegate creator". |
JavaType |
getDelegateType(DeserializationConfig config)
Method that can be used to determine what is the type of delegate type to use, if any; if no delegates are used, will return null. |
SettableBeanProperty[] |
getFromObjectArguments(DeserializationConfig config)
Method called to determine types of instantiation arguments to use when creating instances with creator arguments (when ValueInstantiator.canCreateFromObjectWith() returns true). |
String |
getValueTypeDesc()
Method that returns description of the value type this instantiator handles. |
AnnotatedWithParams |
getWithArgsCreator()
Method that can be called to try to access member (constructor, static factory method) that is used as the "non-default creator" (constructor or factory method that takes one or more arguments). |
protected JsonMappingException |
wrapException(Throwable t)
|
Methods inherited from class com.fasterxml.jackson.databind.deser.ValueInstantiator |
---|
canInstantiate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String _valueTypeDesc
protected final boolean _cfgEmptyStringsAsObjects
protected AnnotatedWithParams _defaultCreator
createUsingDefault(com.fasterxml.jackson.databind.DeserializationContext)
)
protected AnnotatedWithParams _withArgsCreator
protected CreatorProperty[] _constructorArguments
protected JavaType _delegateType
protected AnnotatedWithParams _delegateCreator
protected CreatorProperty[] _delegateArguments
protected AnnotatedWithParams _fromStringCreator
protected AnnotatedWithParams _fromIntCreator
protected AnnotatedWithParams _fromLongCreator
protected AnnotatedWithParams _fromDoubleCreator
protected AnnotatedWithParams _fromBooleanCreator
Constructor Detail |
---|
public StdValueInstantiator(DeserializationConfig config, Class<?> valueType)
public StdValueInstantiator(DeserializationConfig config, JavaType valueType)
protected StdValueInstantiator(StdValueInstantiator src)
Method Detail |
---|
public void configureFromObjectSettings(AnnotatedWithParams defaultCreator, AnnotatedWithParams delegateCreator, JavaType delegateType, CreatorProperty[] delegateArgs, AnnotatedWithParams withArgsCreator, CreatorProperty[] constructorArgs)
public void configureFromStringCreator(AnnotatedWithParams creator)
public void configureFromIntCreator(AnnotatedWithParams creator)
public void configureFromLongCreator(AnnotatedWithParams creator)
public void configureFromDoubleCreator(AnnotatedWithParams creator)
public void configureFromBooleanCreator(AnnotatedWithParams creator)
public String getValueTypeDesc()
ValueInstantiator
getValueTypeDesc
in class ValueInstantiator
public boolean canCreateFromString()
ValueInstantiator
canCreateFromString
in class ValueInstantiator
public boolean canCreateFromInt()
ValueInstantiator
ValueInstantiator.createFromInt(com.fasterxml.jackson.databind.DeserializationContext, int)
).
canCreateFromInt
in class ValueInstantiator
public boolean canCreateFromLong()
ValueInstantiator
ValueInstantiator.createFromLong(com.fasterxml.jackson.databind.DeserializationContext, long)
).
canCreateFromLong
in class ValueInstantiator
public boolean canCreateFromDouble()
ValueInstantiator
ValueInstantiator.createFromDouble(com.fasterxml.jackson.databind.DeserializationContext, double)
).
canCreateFromDouble
in class ValueInstantiator
public boolean canCreateFromBoolean()
ValueInstantiator
ValueInstantiator.createFromDouble(com.fasterxml.jackson.databind.DeserializationContext, double)
).
canCreateFromBoolean
in class ValueInstantiator
public boolean canCreateUsingDefault()
ValueInstantiator
canCreateUsingDefault
in class ValueInstantiator
public boolean canCreateUsingDelegate()
ValueInstantiator
canCreateUsingDelegate
in class ValueInstantiator
public boolean canCreateFromObjectWith()
ValueInstantiator
canCreateFromObjectWith
in class ValueInstantiator
public JavaType getDelegateType(DeserializationConfig config)
ValueInstantiator
getDelegateType
in class ValueInstantiator
public SettableBeanProperty[] getFromObjectArguments(DeserializationConfig config)
ValueInstantiator
ValueInstantiator.canCreateFromObjectWith()
returns true).
These arguments are bound from JSON, using specified
property types to locate deserializers.
NOTE: all properties will be of type
CreatorProperty
.
getFromObjectArguments
in class ValueInstantiator
public Object createUsingDefault(DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
ValueInstantiator
This method is called if ValueInstantiator.getFromObjectArguments(com.fasterxml.jackson.databind.DeserializationConfig)
returns
null or empty List.
createUsingDefault
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
ValueInstantiator
This method is called if ValueInstantiator.getFromObjectArguments(com.fasterxml.jackson.databind.DeserializationConfig)
returns
a non-empty List of arguments.
createFromObjectWith
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createUsingDelegate(DeserializationContext ctxt, Object delegate) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
ValueInstantiator
createUsingDelegate
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromString(DeserializationContext ctxt, String value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
createFromString
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromInt(DeserializationContext ctxt, int value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
createFromInt
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromLong(DeserializationContext ctxt, long value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
createFromLong
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromDouble(DeserializationContext ctxt, double value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
createFromDouble
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object createFromBoolean(DeserializationContext ctxt, boolean value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
createFromBoolean
in class ValueInstantiator
IOException
com.fasterxml.jackson.core.JsonProcessingException
public AnnotatedWithParams getDelegateCreator()
ValueInstantiator
ValueInstantiator.canCreateUsingDelegate()
returns true,
this method may return null .
getDelegateCreator
in class ValueInstantiator
public AnnotatedWithParams getDefaultCreator()
ValueInstantiator
ValueInstantiator.canCreateUsingDefault()
returns true,
this method may return null .
getDefaultCreator
in class ValueInstantiator
public AnnotatedWithParams getWithArgsCreator()
ValueInstantiator
ValueInstantiator.canCreateFromObjectWith()
returns true,
this method may return null .
getWithArgsCreator
in class ValueInstantiator
protected Object _createFromStringFallbacks(DeserializationContext ctxt, String value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected JsonMappingException wrapException(Throwable t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |