Class ValueInstantiator.Delegating
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ValueInstantiator
ValueInstantiator implementation meant as a base type
that by default delegates methods to specified fallback instantiator.- Since:
- 2.12
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.deser.ValueInstantiator
ValueInstantiator.Base, ValueInstantiator.Delegating, ValueInstantiator.Gettable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanMethod that can be called to check whether a double (boolean / Boolean) based creator is available to use (to callValueInstantiator.createFromDouble(tools.jackson.databind.DeserializationContext, double)).booleanMethod that can be called to check whether a double (double / Double) based creator is available to use (to callValueInstantiator.createFromDouble(tools.jackson.databind.DeserializationContext, double)).booleanMethod that can be called to check whether an integer (int, Integer) based creator is available to use (to callValueInstantiator.createFromInt(tools.jackson.databind.DeserializationContext, int)).booleanMethod that can be called to check whether a long (long, Long) based creator is available to use (to callValueInstantiator.createFromLong(tools.jackson.databind.DeserializationContext, long)).booleanMethod that can be called to check whether a property-based creator (argument-taking constructor or factory method) is available to instantiate values from JSON ObjectbooleanMethod that can be called to check whether a String-based creator is available for this instantiator.booleanMethod that can be called to check whether a array-delegate-based creator (single-arg constructor or factory method) is available for this instantiatorbooleanMethod that can be called to check whether a default creator (constructor, or no-arg static factory method) is available for this instantiatorbooleanMethod that can be called to check whether a delegate-based creator (single-arg constructor or factory method) is available for this instantiatorbooleanMethod that will return true if any ofcanCreateXxxmethod returns true: that is, if there is any way that an instance could be created.createContextual(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) "Contextualization" method that is called after construction but before first use, to allow instantiator access to context needed to possible resolve its dependencies.createFromBigDecimal(DeserializationContext ctxt, BigDecimal value) createFromBigInteger(DeserializationContext ctxt, BigInteger value) createFromBoolean(DeserializationContext ctxt, boolean value) createFromDouble(DeserializationContext ctxt, double value) createFromInt(DeserializationContext ctxt, int value) createFromLong(DeserializationContext ctxt, long value) 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.createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) Method that delegates toValueInstantiator.createFromObjectWith(DeserializationContext, Object[])by default, but can be overridden if the application should have customized behavior with respect to missing properties.createFromString(DeserializationContext ctxt, String value) createUsingArrayDelegate(DeserializationContext ctxt, Object delegate) Method to called to create value instance from JSON Array using an intermediate "delegate" value to pass to createor methodMethod 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.createUsingDelegate(DeserializationContext ctxt, Object delegate) Method to called to create value instance from JSON Object using an intermediate "delegate" value to pass to createor methodprotected ValueInstantiatordelegate()Method that can be called to try to access member (constructor, static factory method) that is used as the "array delegate creator".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.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).Method that can be called to try to access member (constructor, static factory method) that is used as the "delegate creator".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.Method called to determine types of instantiation arguments to use when creating instances with creator arguments (whenValueInstantiator.canCreateFromObjectWith()returns true).Class<?>Accessor for raw (type-erased) type of instances to create.Method that returns description of the value type this instantiator handles.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).Methods inherited from class tools.jackson.databind.deser.ValueInstantiator
canCreateFromBigDecimal, canCreateFromBigInteger, createUsingDefaultOrWithoutArguments
-
Field Details
-
_delegate
-
-
Constructor Details
-
Delegating
-
-
Method Details
-
createContextual
public ValueInstantiator createContextual(DeserializationContext ctxt, BeanDescription.Supplier beanDescRef) Description copied from class:ValueInstantiator"Contextualization" method that is called after construction but before first use, to allow instantiator access to context needed to possible resolve its dependencies.- Specified by:
createContextualin classValueInstantiator- Parameters:
ctxt- Currently active deserialization context: needed to (for example) resolvingTypeDeserializers.- Returns:
- This instance, if no change, or newly constructed instance
-
delegate
-
getValueClass
Description copied from class:ValueInstantiatorAccessor for raw (type-erased) type of instances to create.- Specified by:
getValueClassin classValueInstantiator
-
getValueTypeDesc
Description copied from class:ValueInstantiatorMethod that returns description of the value type this instantiator handles. Used for error messages, diagnostics.- Specified by:
getValueTypeDescin classValueInstantiator
-
canInstantiate
public boolean canInstantiate()Description copied from class:ValueInstantiatorMethod that will return true if any ofcanCreateXxxmethod returns true: that is, if there is any way that an instance could be created.- Overrides:
canInstantiatein classValueInstantiator
-
canCreateFromString
public boolean canCreateFromString()Description copied from class:ValueInstantiatorMethod that can be called to check whether a String-based creator is available for this instantiator.NOTE: does NOT include possible case of fallbacks, or coercion; only considers explicit creator.
- Overrides:
canCreateFromStringin classValueInstantiator
-
canCreateFromInt
public boolean canCreateFromInt()Description copied from class:ValueInstantiatorMethod that can be called to check whether an integer (int, Integer) based creator is available to use (to callValueInstantiator.createFromInt(tools.jackson.databind.DeserializationContext, int)).- Overrides:
canCreateFromIntin classValueInstantiator
-
canCreateFromLong
public boolean canCreateFromLong()Description copied from class:ValueInstantiatorMethod that can be called to check whether a long (long, Long) based creator is available to use (to callValueInstantiator.createFromLong(tools.jackson.databind.DeserializationContext, long)).- Overrides:
canCreateFromLongin classValueInstantiator
-
canCreateFromDouble
public boolean canCreateFromDouble()Description copied from class:ValueInstantiatorMethod that can be called to check whether a double (double / Double) based creator is available to use (to callValueInstantiator.createFromDouble(tools.jackson.databind.DeserializationContext, double)).- Overrides:
canCreateFromDoublein classValueInstantiator
-
canCreateFromBoolean
public boolean canCreateFromBoolean()Description copied from class:ValueInstantiatorMethod that can be called to check whether a double (boolean / Boolean) based creator is available to use (to callValueInstantiator.createFromDouble(tools.jackson.databind.DeserializationContext, double)).- Overrides:
canCreateFromBooleanin classValueInstantiator
-
canCreateUsingDefault
public boolean canCreateUsingDefault()Description copied from class:ValueInstantiatorMethod that can be called to check whether a default creator (constructor, or no-arg static factory method) is available for this instantiator- Overrides:
canCreateUsingDefaultin classValueInstantiator
-
canCreateUsingDelegate
public boolean canCreateUsingDelegate()Description copied from class:ValueInstantiatorMethod that can be called to check whether a delegate-based creator (single-arg constructor or factory method) is available for this instantiator- Overrides:
canCreateUsingDelegatein classValueInstantiator
-
canCreateUsingArrayDelegate
public boolean canCreateUsingArrayDelegate()Description copied from class:ValueInstantiatorMethod that can be called to check whether a array-delegate-based creator (single-arg constructor or factory method) is available for this instantiator- Overrides:
canCreateUsingArrayDelegatein classValueInstantiator
-
canCreateFromObjectWith
public boolean canCreateFromObjectWith()Description copied from class:ValueInstantiatorMethod 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- Overrides:
canCreateFromObjectWithin classValueInstantiator
-
getFromObjectArguments
Description copied from class:ValueInstantiatorMethod called to determine types of instantiation arguments to use when creating instances with creator arguments (whenValueInstantiator.canCreateFromObjectWith()returns true). These arguments are bound from JSON, using specified property types to locate deserializers.NOTE: all properties will be of type
CreatorProperty.- Overrides:
getFromObjectArgumentsin classValueInstantiator
-
getDelegateType
Description copied from class:ValueInstantiatorMethod 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. If non-null type is returned, deserializer will bind JSON into specified type (using standard deserializer for that type), and pass that to instantiator.- Overrides:
getDelegateTypein classValueInstantiator
-
getArrayDelegateType
Description copied from class:ValueInstantiatorMethod 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. If non-null type is returned, deserializer will bind JSON into specified type (using standard deserializer for that type), and pass that to instantiator.- Overrides:
getArrayDelegateTypein classValueInstantiator
-
createUsingDefault
Description copied from class:ValueInstantiatorMethod 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. It will only be used if more specific creator methods are not applicable; hence "default".This method is called if
ValueInstantiator.getFromObjectArguments(tools.jackson.databind.DeserializationConfig)returns null or empty List.- Overrides:
createUsingDefaultin classValueInstantiator- Throws:
JacksonException
-
createFromObjectWith
public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws JacksonException Description copied from class:ValueInstantiatorMethod 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.This method is called if
ValueInstantiator.getFromObjectArguments(tools.jackson.databind.DeserializationConfig)returns a non-empty List of arguments.- Overrides:
createFromObjectWithin classValueInstantiator- Throws:
JacksonException
-
createFromObjectWith
public Object createFromObjectWith(DeserializationContext ctxt, SettableBeanProperty[] props, PropertyValueBuffer buffer) throws JacksonException Description copied from class:ValueInstantiatorMethod that delegates toValueInstantiator.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(tools.jackson.databind.DeserializationContext, tools.jackson.databind.deser.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, usePropertyValueBuffer.hasParameter(tools.jackson.databind.deser.SettableBeanProperty)andPropertyValueBuffer.getParameter(tools.jackson.databind.DeserializationContext, tools.jackson.databind.deser.SettableBeanProperty)to safely read the present properties only, and to have some other behavior for the missing properties.- Overrides:
createFromObjectWithin classValueInstantiator- Throws:
JacksonException
-
createUsingDelegate
public Object createUsingDelegate(DeserializationContext ctxt, Object delegate) throws JacksonException Description copied from class:ValueInstantiatorMethod to called to create value instance from JSON Object using an intermediate "delegate" value to pass to createor method- Overrides:
createUsingDelegatein classValueInstantiator- Throws:
JacksonException
-
createUsingArrayDelegate
public Object createUsingArrayDelegate(DeserializationContext ctxt, Object delegate) throws JacksonException Description copied from class:ValueInstantiatorMethod to called to create value instance from JSON Array using an intermediate "delegate" value to pass to createor method- Overrides:
createUsingArrayDelegatein classValueInstantiator- Throws:
JacksonException
-
createFromString
- Overrides:
createFromStringin classValueInstantiator- Throws:
JacksonException
-
createFromInt
- Overrides:
createFromIntin classValueInstantiator- Throws:
JacksonException
-
createFromLong
- Overrides:
createFromLongin classValueInstantiator- Throws:
JacksonException
-
createFromBigInteger
public Object createFromBigInteger(DeserializationContext ctxt, BigInteger value) throws JacksonException - Overrides:
createFromBigIntegerin classValueInstantiator- Throws:
JacksonException
-
createFromDouble
- Overrides:
createFromDoublein classValueInstantiator- Throws:
JacksonException
-
createFromBigDecimal
public Object createFromBigDecimal(DeserializationContext ctxt, BigDecimal value) throws JacksonException - Overrides:
createFromBigDecimalin classValueInstantiator- Throws:
JacksonException
-
createFromBoolean
- Overrides:
createFromBooleanin classValueInstantiator- Throws:
JacksonException
-
getDefaultCreator
Description copied from class:ValueInstantiatorMethod 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). Note that implementations not required to return actual object they use (or, they may use some other instantiation) method. That is, even ifValueInstantiator.canCreateUsingDefault()returns true, this method may return null .- Overrides:
getDefaultCreatorin classValueInstantiator
-
getDelegateCreator
Description copied from class:ValueInstantiatorMethod that can be called to try to access member (constructor, static factory method) that is used as the "delegate creator". Note that implementations not required to return actual object they use (or, they may use some other instantiation) method. That is, even ifValueInstantiator.canCreateUsingDelegate()returns true, this method may return null .- Overrides:
getDelegateCreatorin classValueInstantiator
-
getArrayDelegateCreator
Description copied from class:ValueInstantiatorMethod that can be called to try to access member (constructor, static factory method) that is used as the "array delegate creator". Note that implementations not required to return actual object they use (or, they may use some other instantiation) method. That is, even ifValueInstantiator.canCreateUsingArrayDelegate()returns true, this method may return null .- Overrides:
getArrayDelegateCreatorin classValueInstantiator
-
getWithArgsCreator
Description copied from class:ValueInstantiatorMethod 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). Note that implementations not required to return actual object they use (or, they may use some other instantiation) method. That is, even ifValueInstantiator.canCreateFromObjectWith()returns true, this method may return null .- Overrides:
getWithArgsCreatorin classValueInstantiator
-