public static class ValueInstantiator.Delegating extends ValueInstantiator implements Serializable
ValueInstantiator
implementation meant as a base type
that by default delegates methods to specified fallback instantiator.ValueInstantiator.Base, ValueInstantiator.Delegating, ValueInstantiator.Gettable
Modifier and Type | Field and Description |
---|---|
protected ValueInstantiator |
_delegate |
Modifier | Constructor and Description |
---|---|
protected |
Delegating(ValueInstantiator delegate) |
Modifier and Type | Method and Description |
---|---|
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 |
canCreateUsingArrayDelegate()
Method that can be called to check whether a array-delegate-based creator
(single-arg constructor or factory method)
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
|
boolean |
canInstantiate()
Method that will return true if any of
canCreateXxx method
returns true: that is, if there is any way that an instance could
be created. |
ValueInstantiator |
createContextual(DeserializationContext ctxt,
BeanDescription beanDesc)
"Contextualization" method that is called after construction but before first
use, to allow instantiator access to context needed to possible resolve its
dependencies.
|
Object |
createFromBigDecimal(DeserializationContext ctxt,
BigDecimal value) |
Object |
createFromBigInteger(DeserializationContext ctxt,
BigInteger value) |
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 |
createFromObjectWith(DeserializationContext ctxt,
SettableBeanProperty[] props,
PropertyValueBuffer buffer)
Method that delegates to
ValueInstantiator.createFromObjectWith(DeserializationContext, Object[]) by
default, but can be overridden if the application should have customized
behavior with respect to missing properties. |
Object |
createFromString(DeserializationContext ctxt,
String value) |
Object |
createUsingArrayDelegate(DeserializationContext ctxt,
Object delegate)
Method to called to create value instance from JSON Array using
an intermediate "delegate" value to pass to createor method
|
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
|
protected ValueInstantiator |
delegate() |
AnnotatedWithParams |
getArrayDelegateCreator()
Method that can be called to try to access member (constructor,
static factory method) that is used as the "array delegate creator".
|
JavaType |
getArrayDelegateType(DeserializationConfig config)
Method that can be used to determine what is the type of array delegate
type to use, if any; if no delegates are used, will return null.
|
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). |
Class<?> |
getValueClass()
Accessor for raw (type-erased) type of instances to create.
|
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).
|
_createFromStringFallbacks, canCreateFromBigDecimal, canCreateFromBigInteger
protected final ValueInstantiator _delegate
protected Delegating(ValueInstantiator delegate)
public ValueInstantiator createContextual(DeserializationContext ctxt, BeanDescription beanDesc) throws JsonMappingException
ValueInstantiator
createContextual
in class ValueInstantiator
ctxt
- Currently active deserialization context: needed to (for example)
resolving TypeDeserializer
s.JsonMappingException
- If there are issues with contextualizationprotected ValueInstantiator delegate()
public Class<?> getValueClass()
ValueInstantiator
NOTE: since this method has not existed since beginning of
Jackson 2.0 series, default implementation will just return
Object.class
; implementations are expected
to override it with real value.
getValueClass
in class ValueInstantiator
public String getValueTypeDesc()
ValueInstantiator
getValueTypeDesc
in class ValueInstantiator
public boolean canInstantiate()
ValueInstantiator
canCreateXxx
method
returns true: that is, if there is any way that an instance could
be created.canInstantiate
in class ValueInstantiator
public boolean canCreateFromString()
ValueInstantiator
NOTE: does NOT include possible case of fallbacks, or coercion; only considers explicit creator.
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 canCreateUsingArrayDelegate()
ValueInstantiator
canCreateUsingArrayDelegate
in class ValueInstantiator
public boolean canCreateFromObjectWith()
ValueInstantiator
canCreateFromObjectWith
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 JavaType getDelegateType(DeserializationConfig config)
ValueInstantiator
getDelegateType
in class ValueInstantiator
public JavaType getArrayDelegateType(DeserializationConfig config)
ValueInstantiator
getArrayDelegateType
in class ValueInstantiator
public Object createUsingDefault(DeserializationContext ctxt) throws IOException
ValueInstantiator
This method is called if ValueInstantiator.getFromObjectArguments(com.fasterxml.jackson.databind.DeserializationConfig)
returns
null or empty List.
createUsingDefault
in class ValueInstantiator
IOException
public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException
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
public Object createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) throws IOException
ValueInstantiator
ValueInstantiator.createFromObjectWith(DeserializationContext, Object[])
by
default, but can be overridden if the application should have customized
behavior with respect to missing properties.
The default implementation of this method uses
PropertyValueBuffer.getParameters(SettableBeanProperty[])
to read
and validate all properties in bulk, possibly substituting defaults for
missing properties or throwing exceptions for missing properties. An
overridden implementation of this method could, for example, use
PropertyValueBuffer.hasParameter(SettableBeanProperty)
and
PropertyValueBuffer.getParameter(SettableBeanProperty)
to safely
read the present properties only, and to have some other behavior for the
missing properties.
createFromObjectWith
in class ValueInstantiator
IOException
public Object createUsingDelegate(DeserializationContext ctxt, Object delegate) throws IOException
ValueInstantiator
createUsingDelegate
in class ValueInstantiator
IOException
public Object createUsingArrayDelegate(DeserializationContext ctxt, Object delegate) throws IOException
ValueInstantiator
createUsingArrayDelegate
in class ValueInstantiator
IOException
public Object createFromString(DeserializationContext ctxt, String value) throws IOException
createFromString
in class ValueInstantiator
IOException
public Object createFromInt(DeserializationContext ctxt, int value) throws IOException
createFromInt
in class ValueInstantiator
IOException
public Object createFromLong(DeserializationContext ctxt, long value) throws IOException
createFromLong
in class ValueInstantiator
IOException
public Object createFromBigInteger(DeserializationContext ctxt, BigInteger value) throws IOException
createFromBigInteger
in class ValueInstantiator
IOException
public Object createFromDouble(DeserializationContext ctxt, double value) throws IOException
createFromDouble
in class ValueInstantiator
IOException
public Object createFromBigDecimal(DeserializationContext ctxt, BigDecimal value) throws IOException
createFromBigDecimal
in class ValueInstantiator
IOException
public Object createFromBoolean(DeserializationContext ctxt, boolean value) throws IOException
createFromBoolean
in class ValueInstantiator
IOException
public AnnotatedWithParams getDefaultCreator()
ValueInstantiator
ValueInstantiator.canCreateUsingDefault()
returns true,
this method may return null .getDefaultCreator
in class ValueInstantiator
public AnnotatedWithParams getDelegateCreator()
ValueInstantiator
ValueInstantiator.canCreateUsingDelegate()
returns true,
this method may return null .getDelegateCreator
in class ValueInstantiator
public AnnotatedWithParams getArrayDelegateCreator()
ValueInstantiator
ValueInstantiator.canCreateUsingArrayDelegate()
returns true,
this method may return null .getArrayDelegateCreator
in class ValueInstantiator
public AnnotatedWithParams getWithArgsCreator()
ValueInstantiator
ValueInstantiator.canCreateFromObjectWith()
returns true,
this method may return null .getWithArgsCreator
in class ValueInstantiator
Copyright © 2008–2020 FasterXML. All rights reserved.