- All Implemented Interfaces:
ObjectReadContext
- Direct Known Subclasses:
DeserializationContextExt
ObjectMapper (and ObjectReader based on
configuration,
used mostly by ValueDeserializers to access contextual information.-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.jackson.core.ObjectReadContext
ObjectReadContext.Base -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<?>Currently active view, if any.protected ArrayBuildersprotected ContextAttributesLazily-constructed holder for per-call attributes.protected final DeserializerCacheObject that handle details ofValueDeserializercaching.protected ClassIntrospectorLazily constructedClassIntrospectorinstance: created from "blueprint"protected final DeserializationConfigGeneric deserialization processing configurationprotected LinkedNode<JavaType>Type ofValueDeserializeron whichValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)is being called currently.protected DateFormatprotected final DeserializerFactoryRead-only factory instance; exposed to let owners (ObjectMapper,ObjectReader) access it.protected final intBitmap ofDeserializationFeatures that are enabledprotected final InjectableValuesObject used for resolving references to injectable values.protected ObjectBufferprotected JsonParserCurrently active parser used for deserialization.protected JacksonFeatureSet<StreamReadCapability>Capabilities of the input format.protected final FormatSchemaSchema for underlying parser to use, if any.protected final TokenStreamFactoryLow-levelTokenStreamFactorythat may be used for constructing embedded parsers. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeserializationContext(TokenStreamFactory streamFactory, DeserializerFactory df, DeserializerCache cache, DeserializationConfig config, FormatSchema schema, InjectableValues injectableValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected DateFormatHelper method to get a non-shared instance ofDateFormatwith default configuration; instance is lazily constructed, reused within same instance of context (that is, within same life-cycle ofreadValue()from mapper or reader).protected boolean_isCompatible(Class<?> target, Object value) protected StringHelper method for constructing description like "Object value" givenJsonTokenencountered.Convenience method, equivalent to:final TokenBufferConvenience method that is equivalent to:Factory method used for creatingTokenBufferto temporarily contain copy of content read from specified parser; usually for purpose of reading contents later on (possibly augmeneted with injected additional content)final booleanConvenience method for accessing serialization view in use (if any); equivalent to:abstract voidMethod called to ensure that every object id encounter during processing are resolved.protected ClassIntrospectorConvenience method for constructing Calendar instance set to specified time, to be modified and used by caller.constructSpecializedType(JavaType baseType, Class<?> subclass) Convenience method for constructing subtypes, retaining generic type parameter (if any).final JavaTypeconstructType(Class<?> cls) Convenience method, functionally equivalent to:abstract ValueDeserializer<Object>deserializerInstance(Annotated annotated, Object deserDef) extractScalarFromObject(JsonParser p, ValueDeserializer<?> deser, Class<?> scalarType) Method to call in case incoming shape is Object Value (and parser thereby points toJsonToken.START_OBJECTtoken), but a Scalar value (potentially coercible from String value) is expected.Class<?>Helper method that is to be used when resolving basic class name into Class instance, the reason being that it may be necessary to work around various ClassLoader limitations, as well as to handle primitive type signatures.findCoercionAction(LogicalType targetType, Class<?> targetClass, CoercionInputShape inputShape) General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.findCoercionFromBlankString(LogicalType targetType, Class<?> targetClass, CoercionAction actionIfBlankNotAllowed) More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one).final ValueDeserializer<Object>findContextualValueDeserializer(JavaType type, BeanProperty prop) Method for finding a value deserializer, and creating a contextual version if necessary, for value reached via specified property.final ObjectfindInjectableValue(Object valueId, BeanProperty forProperty, Object beanInstance, Boolean optional, Boolean useInput) final KeyDeserializerfindKeyDeserializer(JavaType keyType, BeanProperty prop) final ValueDeserializer<Object>Variant that will try to locate deserializer for current type, but without performing any contextualization (unlikefindContextualValueDeserializer(tools.jackson.databind.JavaType, tools.jackson.databind.BeanProperty)) or checking for need to create aTypeDeserializer(unlikefindRootValueDeserializer(JavaType).abstract ReadableObjectIdfindObjectId(Object id, ObjectIdGenerator<?> generator, ObjectIdResolver resolver) Method called to find and return entry corresponding to given Object Id: will add an entry if necessary, and never returns nullfindPropertyContentTypeDeserializer(JavaType containerType, AnnotatedMember accessor) Method called to find and create a type information deserializer for values of given container (list, array, map) property, if one is needed.findPropertyTypeDeserializer(JavaType baseType, AnnotatedMember accessor) Method called to create a type information deserializer for values of given non-container property, if one is needed.findRootName(Class<?> rawRootType) findRootName(JavaType rootType) final ValueDeserializer<Object>Method for finding a deserializer for root-level value.findTypeDeserializer(JavaType baseType) Method called to find and create a type information deserializer for given base type, if one is needed.findTypeDeserializer(JavaType baseType, AnnotatedClass classAnnotations) voidMethod that will drop all dynamically constructed deserializers (ones that are counted as result value forDeserializerCache.cachedDeserializersCount()).final Class<?>Accessor for locating currently active view, if any; returns null if no view has been set.final AnnotationIntrospectorConvenience method for accessing serialization view in use (if any); equivalent to:final ArrayBuildersMethod for accessing object useful for building arrays of primitive types (such as int[]).getAttribute(Object key) Method for accessing attributes available in this context.final Base64VariantConvenience method for accessing the default Base64 encoding used for decoding base64 encoded binary content.Accessor to currently active configuration (both per-request configs and per-mapper config).Accessor toJavaTypeof currently contextualizedValueDeserializer, if any.final DatatypeFeaturesfinal JsonFormat.ValuegetDefaultPropertyFormat(Class<?> baseType) final intBulk access method for getting the bit mask of allDeserializationFeatures that are enabled.intgetFormatReadFeatures(int defaults) Method for accessing default Locale to use: convenience method forfinal JsonNodeFactoryConvenience method, functionally equivalent to:final JsonParserMethod for accessing the currently active parser.intgetStreamReadFeatures(int defaults) Method for accessing default TimeZone to use: convenience method forfinal TypeFactoryvoidhandleBadMerge(ValueDeserializer<?> deser) Method that deserializer may call if it is called to do an update ("merge") but deserializer operates on a non-mergeable type.handleInstantiationProblem(Class<?> instClass, Object argument, Throwable t) Method that deserializers should call if they fail to instantiate value due to an exception that was thrown by constructor (or other mechanism used to create instances).handleMissingInstantiator(Class<?> instClass, ValueInstantiator valueInst, JsonParser p, String msg, Object... msgArgs) Method that deserializers should call if they fail to instantiate value due to lack of viable instantiator (usually creator, that is, constructor or static factory method).handleMissingTypeId(JavaType baseType, TypeIdResolver idResolver, String extraDesc) handlePrimaryContextualization(ValueDeserializer<?> deser, BeanProperty prop, JavaType type) Method called for primary property deserializers (ones directly created to deserialize values of a POJO property), to handle details of callingValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)with given property context.handleSecondaryContextualization(ValueDeserializer<?> deser, BeanProperty prop, JavaType type) Method called for secondary property deserializers (ones NOT directly created to deal with an annotatable POJO property, but instead created as a component -- such as value deserializers for structured types, or deserializers for root values) to handle details of resolvingValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)with given property context.handleUnexpectedToken(Class<?> instClass, JsonParser p) handleUnexpectedToken(JavaType targetType, JsonParser p) Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle).handleUnexpectedToken(JavaType targetType, JsonToken t, JsonParser p, String msg, Object... msgArgs) Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle).booleanhandleUnknownProperty(JsonParser p, ValueDeserializer<?> deser, Object instanceOrClass, String propName) Method that deserializers should call if they encounter an unrecognized property (and once that is not explicitly designed as ignorable), to inform possibly configuredDeserializationProblemHandlers and let it handle the problem.handleUnknownTypeId(JavaType baseType, String id, TypeIdResolver idResolver, String extraDesc) Method that deserializers should call if they encounter a type id (for polymorphic deserialization) that cannot be resolved to an actual type; usually since there is no mapping defined.handleWeirdKey(Class<?> keyClass, String keyValue, String msg, Object... msgArgs) Method that deserializers should call if they encounter a String value that cannot be converted to expected key of aMapvalued property.handleWeirdNativeValue(JavaType targetType, Object badValue, JsonParser p) handleWeirdNumberValue(Class<?> targetClass, Number value, String msg, Object... msgArgs) Method that deserializers should call if they encounter a numeric value that cannot be converted to target property type, in cases where some numeric values could be acceptable (either with different settings, or different numeric value).handleWeirdStringValue(Class<?> targetClass, String value, String msg, Object... msgArgs) Method that deserializers should call if they encounter a String value that cannot be converted to target property type, in cases where some String values could be acceptable (either with different settings, or different value).final booleanhasDeserializationFeatures(int featureMask) Bulk access method for checking that all features specified by mask are enabled.booleanhasExplicitDeserializerFor(Class<?> valueType) Method that can be used to see whether there is an explicitly registered deserializer for given type: this is true for supported JDK types, as well as third-party types for whichModuleprovides support but is NOT true (that is, returnsfalse) for POJO types for whichBeanDeserializeris generated based on discovered properties.final booleanhasSomeOfFeatures(int featureMask) Bulk access method for checking that at least one of features specified by mask is enabled.instantiationException(Class<?> instClass, String msg0) Helper method for constructing instantiation exception for specified type, to indicate that instantiation failed due to missing instantiator (creator; constructor or factory method).instantiationException(Class<?> instClass, Throwable cause) Helper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor)introspectBeanDescription(JavaType type, AnnotatedClass ac) introspectBeanDescriptionForBuilder(JavaType builderType, BeanDescription valueTypeDesc) invalidTypeIdException(JavaType baseType, String typeId, String extraDesc) Helper method for constructing exception to indicate that given type id could not be resolved to a valid subtype of specified base type.final booleanAccessor for checking whether input format has specified capability or not.final booleanisEnabled(DatatypeFeature feature) Method for checking whether specified datatype feature is enabled or not.final booleanConvenience method for checking whether specified on/off feature is enabledfinal booleanisEnabled(MapperFeature feature) Convenience method for checking whether specified Mapper feature is enabled or not.abstract KeyDeserializerkeyDeserializerInstance(Annotated annotated, Object deserDef) lazyIntrospectBeanDescriptionForBuilder(JavaType builderType, BeanDescription valueTypeDesc) final ObjectBufferMethod that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists.missingInjectableValueException(String msg, Object valueId, BeanProperty forProperty, Object beanInstance) missingTypeIdException(JavaType baseType, String extraDesc) Convenience method for parsing a Date from given String, using currently configured date format (accessed usingMapperConfig.getDateFormat()).<T> TreadPropertyValue(JsonParser p, BeanProperty prop, Class<T> type) Convenience method that may be used by composite or container deserializers, for reading one-off values for the composite type, taking into account annotations that the property (passed to this method -- usually property that has custom serializer that called this method) has.<T> TreadPropertyValue(JsonParser p, BeanProperty prop, JavaType type) Same asreadPropertyValue(JsonParser, BeanProperty, Class)but with fully resolvedJavaTypeas target: needs to be used for generic types, for example.<T> TreadTreeAsValue(JsonNode n, Class<T> targetType) Helper method similar toObjectReader.treeToValue(TreeNode, Class)which will read contents of given tree (JsonNode) and bind them into specified target type.<T> TreadTreeAsValue(JsonNode n, JavaType targetType) <T> TreadValue(JsonParser p, Class<T> type) Convenience method that may be used by composite or container deserializers, for reading one-off values contained (for sequences, it is more efficient to actually fetch deserializer once for the whole collection).<T> TreadValue(JsonParser p, ResolvedType type) <T> TreadValue(JsonParser p, TypeReference<T> refType) <T> TreadValue(JsonParser p, JavaType type) <T> TreportBadCoercion(ValueDeserializer<?> src, Class<?> targetType, Object inputValue, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where specific input coercion was not allowed.<T> TreportBadDefinition(JavaType type, String msg) Helper method called to indicate a generic problem that stems from type definition(s), not input data, or input/output state; typically this means throwing aInvalidDefinitionException.<T> TreportBadPropertyDefinition(BeanDescription.Supplier beanDescRef, BeanPropertyDefinition prop, String msg, Object... msgArgs) Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific property (of a type), unrelated to actual JSON content to map.<T> TreportBadPropertyDefinition(BeanDescription bean, BeanPropertyDefinition prop, String msg, Object... msgArgs) <T> TreportBadTypeDefinition(BeanDescription bean, String msg, Object... msgArgs) Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific Java type, unrelated to actual JSON content to map.<T> TreportInputMismatch(Class<?> targetType, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportInputMismatch(BeanProperty prop, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportInputMismatch(JavaType targetType, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportInputMismatch(ValueDeserializer<?> src, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportPropertyInputMismatch(Class<?> targetType, String propertyName, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportPropertyInputMismatch(JavaType targetType, String propertyName, String msg, Object... msgArgs) Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.<T> TreportTrailingTokens(Class<?> targetType, JsonParser p, JsonToken trailingToken) <T> TreportUnresolvedObjectId(ObjectIdReader oidReader, Object bean) voidreportWrongTokenException(Class<?> targetType, JsonToken expToken, String msg, Object... msgArgs) Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens.voidreportWrongTokenException(JavaType targetType, JsonToken expToken, String msg, Object... msgArgs) Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens.voidreportWrongTokenException(ValueDeserializer<?> deser, JsonToken expToken, String msg, Object... msgArgs) Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens.final voidMethod to call to return object buffer previously leased withleaseObjectBuffer().setAttribute(Object key, Object value) Method for setting per-call value of given attribute.weirdKeyException(Class<?> keyClass, String keyValue, String msg) Helper method for constructing exception to indicate that given JSON Object field name was not in format to be able to deserialize specified key type.weirdNativeValueException(Object value, Class<?> instClass) Helper method for constructing exception to indicate that input JSON token of type "native value" (seeJsonToken.VALUE_EMBEDDED_OBJECT) is of incompatible type (and there is no delegating creator or such to use) and cannot be used to construct value of specified type (usually POJO).weirdNumberException(Number value, Class<?> instClass, String msg) Helper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given target type.weirdStringException(String value, Class<?> instClass, String msgBase) Helper method for constructing exception to indicate that input JSON String was not suitable for deserializing into given target type.wrongTokenException(JsonParser p, Class<?> targetType, JsonToken expToken, String extra) wrongTokenException(JsonParser p, JavaType targetType, JsonToken expToken, String extra) Helper method for constructingDatabindExceptionto indicate that the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens.Methods inherited from class tools.jackson.databind.DatabindContext
_colonConcat, _desc, _format, _quotedString, _throwNotASubtype, _throwSubtypeClassNotAllowed, _throwSubtypeNameNotAllowed, _truncate, constructType, converterInstance, introspectBeanDescription, introspectClassAnnotations, introspectClassAnnotations, introspectDirectClassAnnotations, isAnnotationProcessingEnabled, lazyIntrospectBeanDescription, objectIdGeneratorInstance, objectIdResolverInstance, reportBadDefinition, reportBadTypeDefinition, resolveAndValidateSubType, resolveSubTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tools.jackson.core.ObjectReadContext
createParser, createParser, createParser, createParser, createParser, treeAsTokens
-
Field Details
-
_streamFactory
Low-levelTokenStreamFactorythat may be used for constructing embedded parsers. -
_factory
Read-only factory instance; exposed to let owners (ObjectMapper,ObjectReader) access it. -
_cache
Object that handle details ofValueDeserializercaching. -
_config
Generic deserialization processing configuration -
_featureFlags
protected final int _featureFlagsBitmap ofDeserializationFeatures that are enabled -
_activeView
Currently active view, if any. -
_schema
Schema for underlying parser to use, if any. -
_injectableValues
Object used for resolving references to injectable values. -
_parser
Currently active parser used for deserialization. May be different from the outermost parser when content is buffered. -
_readCapabilities
Capabilities of the input format. -
_arrayBuilders
-
_objectBuffer
-
_dateFormat
-
_attributes
Lazily-constructed holder for per-call attributes. -
_currentType
Type ofValueDeserializeron whichValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)is being called currently. -
_classIntrospector
Lazily constructedClassIntrospectorinstance: created from "blueprint"
-
-
Constructor Details
-
DeserializationContext
protected DeserializationContext(TokenStreamFactory streamFactory, DeserializerFactory df, DeserializerCache cache, DeserializationConfig config, FormatSchema schema, InjectableValues injectableValues)
-
-
Method Details
-
getConfig
Description copied from class:DatabindContextAccessor to currently active configuration (both per-request configs and per-mapper config).- Specified by:
getConfigin classDatabindContext
-
getActiveView
Description copied from class:DatabindContextAccessor for locating currently active view, if any; returns null if no view has been set.- Specified by:
getActiveViewin classDatabindContext
-
canOverrideAccessModifiers
public final boolean canOverrideAccessModifiers()Description copied from class:DatabindContextConvenience method for accessing serialization view in use (if any); equivalent to:getConfig().canOverrideAccessModifiers();
- Specified by:
canOverrideAccessModifiersin classDatabindContext
-
isEnabled
Description copied from class:DatabindContextConvenience method for checking whether specified Mapper feature is enabled or not. Shortcut for:getConfig().isEnabled(feature);
- Specified by:
isEnabledin classDatabindContext
-
isEnabled
Description copied from class:DatabindContextMethod for checking whether specified datatype feature is enabled or not.- Specified by:
isEnabledin classDatabindContext
-
getDatatypeFeatures
- Specified by:
getDatatypeFeaturesin classDatabindContext
-
getDefaultPropertyFormat
- Specified by:
getDefaultPropertyFormatin classDatabindContext
-
getAnnotationIntrospector
Description copied from class:DatabindContextConvenience method for accessing serialization view in use (if any); equivalent to:getConfig().getAnnotationIntrospector();
- Specified by:
getAnnotationIntrospectorin classDatabindContext
-
getTypeFactory
- Specified by:
getTypeFactoryin classDatabindContext
-
constructSpecializedType
public JavaType constructSpecializedType(JavaType baseType, Class<?> subclass) throws IllegalArgumentException Description copied from class:DatabindContextConvenience method for constructing subtypes, retaining generic type parameter (if any).Note: since 2.11 handling has varied a bit across serialization, deserialization.
- Specified by:
constructSpecializedTypein classDatabindContext- Throws:
IllegalArgumentException
-
getLocale
Method for accessing default Locale to use: convenience method forgetConfig().getLocale();
- Specified by:
getLocalein classDatabindContext
-
getTimeZone
Method for accessing default TimeZone to use: convenience method forgetConfig().getTimeZone();
- Specified by:
getTimeZonein classDatabindContext
-
getAttribute
Description copied from class:DatabindContextMethod for accessing attributes available in this context. Per-call attributes have highest precedence; attributes set viaObjectReaderorObjectWriterhave lower precedence.- Specified by:
getAttributein classDatabindContext- Parameters:
key- Key of the attribute to get- Returns:
- Value of the attribute, if any; null otherwise
-
setAttribute
Description copied from class:DatabindContextMethod for setting per-call value of given attribute. This will override any previously defined value for the attribute within this context.- Specified by:
setAttributein classDatabindContext- Parameters:
key- Key of the attribute to setvalue- Value to set attribute to- Returns:
- This context object, to allow chaining
-
getContextualType
Accessor toJavaTypeof currently contextualizedValueDeserializer, if any. This is sometimes useful for genericValueDeserializers that do not get passed (or do not retain) type information when being constructed: happens for example for deserializers constructed from annotations.- Returns:
- Type of
ValueDeserializerbeing contextualized, if process is on-going; null if not.
-
tokenStreamFactory
- Specified by:
tokenStreamFactoryin interfaceObjectReadContext
-
getSchema
- Specified by:
getSchemain interfaceObjectReadContext
-
streamReadConstraints
- Specified by:
streamReadConstraintsin interfaceObjectReadContext
-
getStreamReadFeatures
public int getStreamReadFeatures(int defaults) - Specified by:
getStreamReadFeaturesin interfaceObjectReadContext
-
getFormatReadFeatures
public int getFormatReadFeatures(int defaults) - Specified by:
getFormatReadFeaturesin interfaceObjectReadContext
-
createArrayNode
- Specified by:
createArrayNodein interfaceObjectReadContext
-
createObjectNode
- Specified by:
createObjectNodein interfaceObjectReadContext
-
readTree
- Specified by:
readTreein interfaceObjectReadContext- Throws:
JacksonException
-
readValue
Convenience method that may be used by composite or container deserializers, for reading one-off values contained (for sequences, it is more efficient to actually fetch deserializer once for the whole collection).NOTE: when deserializing values of properties contained in composite types, rather use
readPropertyValue(JsonParser, BeanProperty, Class); this method does not allow use of contextual annotations.- Specified by:
readValuein interfaceObjectReadContext- Throws:
JacksonException
-
readValue
- Specified by:
readValuein interfaceObjectReadContext- Throws:
JacksonException
-
readValue
- Specified by:
readValuein interfaceObjectReadContext- Throws:
JacksonException
-
readValue
- Throws:
JacksonException
-
isEnabled
Convenience method for checking whether specified on/off feature is enabled -
getDeserializationFeatures
public final int getDeserializationFeatures()Bulk access method for getting the bit mask of allDeserializationFeatures that are enabled. -
hasDeserializationFeatures
public final boolean hasDeserializationFeatures(int featureMask) Bulk access method for checking that all features specified by mask are enabled. -
hasSomeOfFeatures
public final boolean hasSomeOfFeatures(int featureMask) Bulk access method for checking that at least one of features specified by mask is enabled. -
isEnabled
Accessor for checking whether input format has specified capability or not.- Returns:
- True if input format has specified capability; false if not
-
getParser
Method for accessing the currently active parser. May be different from the outermost parser when content is buffered.Use of this method is discouraged: if code has direct access to the active parser, that should be used instead.
-
findInjectableValue
-
getBase64Variant
Convenience method for accessing the default Base64 encoding used for decoding base64 encoded binary content. Same as calling:getConfig().getBase64Variant();
-
getNodeFactory
Convenience method, functionally equivalent to:getConfig().getNodeFactory();
-
classIntrospector
- Specified by:
classIntrospectorin classDatabindContext
-
introspectBeanDescription
- Specified by:
introspectBeanDescriptionin classDatabindContext
-
introspectBeanDescriptionForCreation
-
introspectBeanDescriptionForCreation
-
lazyIntrospectBeanDescriptionForCreation
-
introspectBeanDescriptionForBuilder
public BeanDescription introspectBeanDescriptionForBuilder(JavaType builderType, BeanDescription valueTypeDesc) -
lazyIntrospectBeanDescriptionForBuilder
public BeanDescription.Supplier lazyIntrospectBeanDescriptionForBuilder(JavaType builderType, BeanDescription valueTypeDesc) -
findRootName
- Specified by:
findRootNamein classDatabindContext
-
findRootName
- Specified by:
findRootNamein classDatabindContext
-
hasExplicitDeserializerFor
Method that can be used to see whether there is an explicitly registered deserializer for given type: this is true for supported JDK types, as well as third-party types for whichModuleprovides support but is NOT true (that is, returnsfalse) for POJO types for whichBeanDeserializeris generated based on discovered properties.Note that it is up to
Modules to implement support for this method: some do (like basicSimpleModule).- Parameters:
valueType- Type-erased type to check- Returns:
- True if this factory has explicit (non-POJO) deserializer for specified type,
or has a provider (of type
Deserializers) that has.
-
findCoercionAction
public CoercionAction findCoercionAction(LogicalType targetType, Class<?> targetClass, CoercionInputShape inputShape) General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested.- Parameters:
targetType- Logical target type of coerciontargetClass- Physical target type of coercioninputShape- Input shape to coerce from- Returns:
- CoercionAction configured for specific coercion
-
findCoercionFromBlankString
public CoercionAction findCoercionFromBlankString(LogicalType targetType, Class<?> targetClass, CoercionAction actionIfBlankNotAllowed) More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one). Will basically first determine if "blank as empty" is allowed: if not, returnsactionIfBlankNotAllowed, otherwise returns action forCoercionInputShape.EmptyString.- Parameters:
targetType- Logical target type of coerciontargetClass- Physical target type of coercionactionIfBlankNotAllowed- Return value to use in case "blanks as empty" is not allowed- Returns:
- CoercionAction configured for specified coercion from blank string
-
bufferForInputBuffering
Factory method used for creatingTokenBufferto temporarily contain copy of content read from specified parser; usually for purpose of reading contents later on (possibly augmeneted with injected additional content) -
bufferForInputBuffering
Convenience method that is equivalent to:ctxt.bufferForInputBuffering(ctxt.getParser());
-
bufferAsCopyOfValue
Convenience method, equivalent to:TokenBuffer buffer = ctxt.bufferForInputBuffering(parser); buffer.copyCurrentStructure(parser); return buffer;
NOTE: the whole "current value" that parser points to is read and buffered, including Object and Array values (if parser pointing to start marker).
- Throws:
JacksonException
-
findContextualValueDeserializer
public final ValueDeserializer<Object> findContextualValueDeserializer(JavaType type, BeanProperty prop) Method for finding a value deserializer, and creating a contextual version if necessary, for value reached via specified property. -
findNonContextualValueDeserializer
Variant that will try to locate deserializer for current type, but without performing any contextualization (unlikefindContextualValueDeserializer(tools.jackson.databind.JavaType, tools.jackson.databind.BeanProperty)) or checking for need to create aTypeDeserializer(unlikefindRootValueDeserializer(JavaType). This method is usually called from withinValueDeserializer.resolve(tools.jackson.databind.DeserializationContext), and expectation is that caller then calls eitherhandlePrimaryContextualization(ValueDeserializer, BeanProperty, JavaType)orhandleSecondaryContextualization(ValueDeserializer, BeanProperty, JavaType)at a later point, as necessary. -
findRootValueDeserializer
Method for finding a deserializer for root-level value. -
findTypeDeserializer
Method called to find and create a type information deserializer for given base type, if one is needed. If not needed (no polymorphic handling configured for type), should return null.Note that this method is usually only directly called for values of container (Collection, array, Map) types and root values, but not for bean property values.
- Parameters:
baseType- Declared base type of the value to deserializer (actual deserializer type will be this type or its subtype)- Returns:
- Type deserializer to use for given base type, if one is needed; null if not.
-
findTypeDeserializer
-
findPropertyTypeDeserializer
Method called to create a type information deserializer for values of given non-container property, if one is needed. If not needed (no polymorphic handling configured for property), should return null.Note that this method is only called for non-container bean properties, and not for values in container types or root values (or container properties)
- Parameters:
baseType- Declared base type of the value to deserializer (actual deserializer type will be this type or its subtype)- Returns:
- Type deserializer to use for given base type, if one is needed; null if not.
- Since:
- 3.0
-
findPropertyContentTypeDeserializer
public TypeDeserializer findPropertyContentTypeDeserializer(JavaType containerType, AnnotatedMember accessor) Method called to find and create a type information deserializer for values of given container (list, array, map) property, if one is needed. If not needed (no polymorphic handling configured for property), should return null.Note that this method is only called for container bean properties, and not for values in container types or root values (or non-container properties)
- Parameters:
containerType- Type of property; must be a container typeaccessor- Field or method that contains container property- Since:
- 3.0
-
findKeyDeserializer
-
flushCachedDeserializers
public void flushCachedDeserializers()Method that will drop all dynamically constructed deserializers (ones that are counted as result value forDeserializerCache.cachedDeserializersCount()). This can be used to remove memory usage (in case some deserializers are only used once or so), or to force re-construction of deserializers after configuration changes for mapper than owns the provider.- Since:
- 2.19
-
findObjectId
public abstract ReadableObjectId findObjectId(Object id, ObjectIdGenerator<?> generator, ObjectIdResolver resolver) Method called to find and return entry corresponding to given Object Id: will add an entry if necessary, and never returns null -
checkUnresolvedObjectId
Method called to ensure that every object id encounter during processing are resolved.- Throws:
UnresolvedForwardReference
-
constructType
Convenience method, functionally equivalent to:getConfig().constructType(cls);
-
findClass
Helper method that is to be used when resolving basic class name into Class instance, the reason being that it may be necessary to work around various ClassLoader limitations, as well as to handle primitive type signatures.- Throws:
ClassNotFoundException
-
leaseObjectBuffer
Method that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists. Note that leased buffers should be returned once deserializer is done, to allow for reuse during same round of deserialization. -
returnObjectBuffer
Method to call to return object buffer previously leased withleaseObjectBuffer().- Parameters:
buf- Returned object buffer
-
getArrayBuilders
Method for accessing object useful for building arrays of primitive types (such as int[]). -
deserializerInstance
public abstract ValueDeserializer<Object> deserializerInstance(Annotated annotated, Object deserDef) -
keyDeserializerInstance
-
handlePrimaryContextualization
public ValueDeserializer<?> handlePrimaryContextualization(ValueDeserializer<?> deser, BeanProperty prop, JavaType type) Method called for primary property deserializers (ones directly created to deserialize values of a POJO property), to handle details of callingValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)with given property context.- Parameters:
prop- Property for which the given primary deserializer is used; never null.
-
handleSecondaryContextualization
public ValueDeserializer<?> handleSecondaryContextualization(ValueDeserializer<?> deser, BeanProperty prop, JavaType type) Method called for secondary property deserializers (ones NOT directly created to deal with an annotatable POJO property, but instead created as a component -- such as value deserializers for structured types, or deserializers for root values) to handle details of resolvingValueDeserializer.createContextual(tools.jackson.databind.DeserializationContext, tools.jackson.databind.BeanProperty)with given property context. Given that these deserializers are not directly related to given property (or, in case of root value property, to any property), annotations accessible may or may not be relevant.- Parameters:
prop- Property for which deserializer is used, if any; null when deserializing root values
-
parseDate
Convenience method for parsing a Date from given String, using currently configured date format (accessed usingMapperConfig.getDateFormat()).Implementation will handle thread-safety issues related to date formats such that first time this method is called, date format is cloned, and cloned instance will be retained for use during this deserialization round.
- Throws:
IllegalArgumentException
-
constructCalendar
Convenience method for constructing Calendar instance set to specified time, to be modified and used by caller. -
extractScalarFromObject
public String extractScalarFromObject(JsonParser p, ValueDeserializer<?> deser, Class<?> scalarType) throws JacksonException Method to call in case incoming shape is Object Value (and parser thereby points toJsonToken.START_OBJECTtoken), but a Scalar value (potentially coercible from String value) is expected. This would typically be used to deserialize a Number, Boolean value or some other "simple" unstructured value type.Note that expected behavior in case of extraction not succeeding changed in Jackson 2.20: now
nullis expected to be returned in that case (in 2.19 and before, exception was to be thrown, but this prevented fallback handling viaDeserializationProblemHandler.handleUnexpectedToken(tools.jackson.databind.DeserializationContext, tools.jackson.databind.JavaType, tools.jackson.core.JsonToken, tools.jackson.core.JsonParser, java.lang.String).- Parameters:
p- Actual parser to read content fromdeser- Deserializer that needs extracted String valuescalarType- Immediate type of scalar to extract; usually type deserializer handles but not always (for example, deserializer forint[]would pass scalar type ofint)- Returns:
- String value found, if any;
nullif none (note: changed in 2.20; before that in 2.19 and before exception throwing was expected) - Throws:
JacksonException- If there are problems either reading content (underlying parser problem) or finding expected scalar value
-
readPropertyValue
public <T> T readPropertyValue(JsonParser p, BeanProperty prop, Class<T> type) throws JacksonException Convenience method that may be used by composite or container deserializers, for reading one-off values for the composite type, taking into account annotations that the property (passed to this method -- usually property that has custom serializer that called this method) has.- Parameters:
p- Parser that points to the first token of the value to readprop- Logical property of a POJO being type- Returns:
- Value of type
typethat was read - Throws:
JacksonException
-
readPropertyValue
public <T> T readPropertyValue(JsonParser p, BeanProperty prop, JavaType type) throws JacksonException Same asreadPropertyValue(JsonParser, BeanProperty, Class)but with fully resolvedJavaTypeas target: needs to be used for generic types, for example.- Throws:
JacksonException
-
readTreeAsValue
Helper method similar toObjectReader.treeToValue(TreeNode, Class)which will read contents of given tree (JsonNode) and bind them into specified target type. This is often used in two-phase deserialization in which content is first read as a tree, then manipulated (adding and/or removing properties of Object values, for example), and finally converted into actual target type using default deserialization logic for the type.NOTE: deserializer implementations should be careful not to try to recursively deserialize into target type deserializer has registered itself to handle.
- Parameters:
n- Tree value to convert, if notnull: ifnull, will simply returnnulltargetType- Type to deserialize contents ofninto (ifnnotnull)- Returns:
- Either
null(ifnwasnullor a value of typetypethat was read from non-nullnargument - Throws:
JacksonException
-
readTreeAsValue
Same asreadTreeAsValue(JsonNode, Class)but will fully resolvedJavaTypeastargetTypeNOTE: deserializer implementations should be careful not to try to recursively deserialize into target type deserializer has registered itself to handle.
- Parameters:
n- Tree value to converttargetType- Type to deserialize contents ofninto- Returns:
- Value of type
typethat was read - Throws:
JacksonException
-
handleUnknownProperty
public boolean handleUnknownProperty(JsonParser p, ValueDeserializer<?> deser, Object instanceOrClass, String propName) throws JacksonException Method that deserializers should call if they encounter an unrecognized property (and once that is not explicitly designed as ignorable), to inform possibly configuredDeserializationProblemHandlers and let it handle the problem.- Returns:
- True if there was a configured problem handler that was able to handle the problem
- Throws:
JacksonException
-
handleWeirdKey
public Object handleWeirdKey(Class<?> keyClass, String keyValue, String msg, Object... msgArgs) throws JacksonException Method that deserializers should call if they encounter a String value that cannot be converted to expected key of aMapvalued property. Default implementation will try to callDeserializationProblemHandler.handleWeirdNumberValue(tools.jackson.databind.DeserializationContext, java.lang.Class<?>, java.lang.Number, java.lang.String)on configured handlers, if any, to allow for recovery; if recovery does not succeed, will throwInvalidFormatExceptionwith given message.- Parameters:
keyClass- Expected type for keykeyValue- String value from which to deserialize keymsg- Error message template caller wants to use if exception is to be thrownmsgArgs- Optional arguments to use for message, if any- Returns:
- Key value to use
- Throws:
JacksonException- To indicate unrecoverable problem, usually based onmsg
-
handleWeirdStringValue
public Object handleWeirdStringValue(Class<?> targetClass, String value, String msg, Object... msgArgs) throws JacksonException Method that deserializers should call if they encounter a String value that cannot be converted to target property type, in cases where some String values could be acceptable (either with different settings, or different value). Default implementation will try to callDeserializationProblemHandler.handleWeirdStringValue(tools.jackson.databind.DeserializationContext, java.lang.Class<?>, java.lang.String, java.lang.String)on configured handlers, if any, to allow for recovery; if recovery does not succeed, will throwInvalidFormatExceptionwith given message.- Parameters:
targetClass- Type of property into which incoming String should be convertedvalue- String value from which to deserialize property valuemsg- Error message template caller wants to use if exception is to be thrownmsgArgs- Optional arguments to use for message, if any- Returns:
- Property value to use
- Throws:
JacksonException- To indicate unrecoverable problem, usually based onmsg
-
handleWeirdNumberValue
public Object handleWeirdNumberValue(Class<?> targetClass, Number value, String msg, Object... msgArgs) throws JacksonException Method that deserializers should call if they encounter a numeric value that cannot be converted to target property type, in cases where some numeric values could be acceptable (either with different settings, or different numeric value). Default implementation will try to callDeserializationProblemHandler.handleWeirdNumberValue(tools.jackson.databind.DeserializationContext, java.lang.Class<?>, java.lang.Number, java.lang.String)on configured handlers, if any, to allow for recovery; if recovery does not succeed, will throwInvalidFormatExceptionwith given message.- Parameters:
targetClass- Type of property into which incoming number should be convertedvalue- Number value from which to deserialize property valuemsg- Error message template caller wants to use if exception is to be thrownmsgArgs- Optional arguments to use for message, if any- Returns:
- Property value to use
- Throws:
JacksonException- To indicate unrecoverable problem, usually based onmsg
-
handleWeirdNativeValue
public Object handleWeirdNativeValue(JavaType targetType, Object badValue, JsonParser p) throws JacksonException - Throws:
JacksonException
-
handleMissingInstantiator
public Object handleMissingInstantiator(Class<?> instClass, ValueInstantiator valueInst, JsonParser p, String msg, Object... msgArgs) throws JacksonException Method that deserializers should call if they fail to instantiate value due to lack of viable instantiator (usually creator, that is, constructor or static factory method). Method should be called at point where value has not been decoded, so that handler has a chance to handle decoding using alternate mechanism, and handle underlying content (possibly by just skipping it) to keep input state valid- Parameters:
instClass- Type that was to be instantiatedvalueInst- (optional) Value instantiator to be used, if any; null if type does not use one for instantiation (custom deserialiers don't; standard POJO deserializer does)p- Parser that points to the JSON value to decode- Returns:
- Object that should be constructed, if any; has to be of type
instClass - Throws:
JacksonException
-
handleInstantiationProblem
public Object handleInstantiationProblem(Class<?> instClass, Object argument, Throwable t) throws JacksonException Method that deserializers should call if they fail to instantiate value due to an exception that was thrown by constructor (or other mechanism used to create instances). Default implementation will try to callDeserializationProblemHandler.handleInstantiationProblem(tools.jackson.databind.DeserializationContext, java.lang.Class<?>, java.lang.Object, java.lang.Throwable)on configured handlers, if any, to allow for recovery; if recovery does not succeed, will throw exception constructed withinstantiationException(java.lang.Class<?>, java.lang.Throwable).- Parameters:
instClass- Type that was to be instantiatedargument- (optional) Argument that was passed to constructor or equivalent instantiator; often aString.t- Exception that caused failure- Returns:
- Object that should be constructed, if any; has to be of type
instClass - Throws:
JacksonException
-
handleUnexpectedToken
- Throws:
JacksonException
-
handleUnexpectedToken
Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). This could occur, for example, if a Number deserializer encounterJsonToken.START_ARRAYinstead ofJsonToken.VALUE_NUMBER_INTorJsonToken.VALUE_NUMBER_FLOAT.- Parameters:
targetType- Type that was to be instantiatedp- Parser that points to the JSON value to decode- Returns:
- Object that should be constructed, if any; has to be of type
instClass - Throws:
JacksonException
-
handleUnexpectedToken
public Object handleUnexpectedToken(JavaType targetType, JsonToken t, JsonParser p, String msg, Object... msgArgs) throws JacksonException Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). This could occur, for example, if a Number deserializer encounterJsonToken.START_ARRAYinstead ofJsonToken.VALUE_NUMBER_INTorJsonToken.VALUE_NUMBER_FLOAT.- Parameters:
targetType- Type that was to be instantiatedt- Token encountered that does not match expectedp- Parser that points to the JSON value to decode- Returns:
- Object that should be constructed, if any; has to be of type
instClass - Throws:
JacksonException
-
handleUnknownTypeId
public JavaType handleUnknownTypeId(JavaType baseType, String id, TypeIdResolver idResolver, String extraDesc) throws JacksonException Method that deserializers should call if they encounter a type id (for polymorphic deserialization) that cannot be resolved to an actual type; usually since there is no mapping defined. Default implementation will try to callDeserializationProblemHandler.handleUnknownTypeId(tools.jackson.databind.DeserializationContext, tools.jackson.databind.JavaType, java.lang.String, tools.jackson.databind.jsontype.TypeIdResolver, java.lang.String)on configured handlers, if any, to allow for recovery; if recovery does not succeed, will throw exception constructed withinvalidTypeIdException(tools.jackson.databind.JavaType, java.lang.String, java.lang.String).- Parameters:
baseType- Base type from which resolution startsid- Type id that could not be convertedextraDesc- Additional problem description to add to default exception message, if resolution fails.- Returns:
JavaTypethat id resolves to- Throws:
JacksonException- To indicate unrecoverable problem, if resolution cannot be made to work
-
handleMissingTypeId
public JavaType handleMissingTypeId(JavaType baseType, TypeIdResolver idResolver, String extraDesc) throws JacksonException - Throws:
JacksonException
-
handleBadMerge
Method that deserializer may call if it is called to do an update ("merge") but deserializer operates on a non-mergeable type. Although this should usually be caught earlier, sometimes it may only be caught during operation and if so this is the method to call. Note that ifMapperFeature.IGNORE_MERGE_FOR_UNMERGEABLEis enabled, this method will simply return null; otherwiseInvalidDefinitionExceptionwill be thrown.- Throws:
DatabindException
-
_isCompatible
-
reportWrongTokenException
public void reportWrongTokenException(ValueDeserializer<?> deser, JsonToken expToken, String msg, Object... msgArgs) throws DatabindException Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. Note that this method will throw aDatabindExceptionand no recovery is attempted (viaDeserializationProblemHandler, as problem is considered to be difficult to recover from, in general.- Throws:
DatabindException
-
reportWrongTokenException
public void reportWrongTokenException(JavaType targetType, JsonToken expToken, String msg, Object... msgArgs) throws DatabindException Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. Note that this method will throw aDatabindExceptionand no recovery is attempted (viaDeserializationProblemHandler, as problem is considered to be difficult to recover from, in general.- Throws:
DatabindException
-
reportWrongTokenException
public void reportWrongTokenException(Class<?> targetType, JsonToken expToken, String msg, Object... msgArgs) throws DatabindException Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. Note that this method will throw aDatabindExceptionand no recovery is attempted (viaDeserializationProblemHandler, as problem is considered to be difficult to recover from, in general.- Throws:
DatabindException
-
reportUnresolvedObjectId
public <T> T reportUnresolvedObjectId(ObjectIdReader oidReader, Object bean) throws DatabindException - Throws:
DatabindException
-
reportInputMismatch
public <T> T reportInputMismatch(ValueDeserializer<?> src, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportInputMismatch
public <T> T reportInputMismatch(Class<?> targetType, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportInputMismatch
public <T> T reportInputMismatch(JavaType targetType, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportInputMismatch
public <T> T reportInputMismatch(BeanProperty prop, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportPropertyInputMismatch
public <T> T reportPropertyInputMismatch(Class<?> targetType, String propertyName, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportPropertyInputMismatch
public <T> T reportPropertyInputMismatch(JavaType targetType, String propertyName, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where more specificreportXxx()method was not available.- Throws:
DatabindException
-
reportBadCoercion
public <T> T reportBadCoercion(ValueDeserializer<?> src, Class<?> targetType, Object inputValue, String msg, Object... msgArgs) throws DatabindException Helper method used to indicate a problem with input in cases where specific input coercion was not allowed.- Throws:
DatabindException
-
reportTrailingTokens
public <T> T reportTrailingTokens(Class<?> targetType, JsonParser p, JsonToken trailingToken) throws DatabindException - Throws:
DatabindException
-
reportBadTypeDefinition
public <T> T reportBadTypeDefinition(BeanDescription bean, String msg, Object... msgArgs) throws DatabindException Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific Java type, unrelated to actual JSON content to map. Default behavior is to construct and throw aDatabindException.- Specified by:
reportBadTypeDefinitionin classDatabindContext- Throws:
DatabindException
-
reportBadPropertyDefinition
public <T> T reportBadPropertyDefinition(BeanDescription.Supplier beanDescRef, BeanPropertyDefinition prop, String msg, Object... msgArgs) throws DatabindException Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific property (of a type), unrelated to actual JSON content to map. Default behavior is to construct and throw aDatabindException.- Throws:
DatabindException
-
reportBadPropertyDefinition
public <T> T reportBadPropertyDefinition(BeanDescription bean, BeanPropertyDefinition prop, String msg, Object... msgArgs) throws DatabindException - Throws:
DatabindException
-
reportBadDefinition
Description copied from class:DatabindContextHelper method called to indicate a generic problem that stems from type definition(s), not input data, or input/output state; typically this means throwing aInvalidDefinitionException.- Specified by:
reportBadDefinitionin classDatabindContext- Throws:
DatabindException
-
wrongTokenException
public DatabindException wrongTokenException(JsonParser p, JavaType targetType, JsonToken expToken, String extra) Helper method for constructingDatabindExceptionto indicate that the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. Note that most of the time this method should NOT be directly called; instead,reportWrongTokenException(tools.jackson.databind.ValueDeserializer<?>, tools.jackson.core.JsonToken, java.lang.String, java.lang.Object...)should be called and will call this method as necessary. -
wrongTokenException
public DatabindException wrongTokenException(JsonParser p, Class<?> targetType, JsonToken expToken, String extra) -
weirdKeyException
Helper method for constructing exception to indicate that given JSON Object field name was not in format to be able to deserialize specified key type. Note that most of the time this method should NOT be called; instead,handleWeirdKey(java.lang.Class<?>, java.lang.String, java.lang.String, java.lang.Object...)should be called which will call this method if necessary. -
weirdStringException
Helper method for constructing exception to indicate that input JSON String was not suitable for deserializing into given target type. Note that most of the time this method should NOT be called; instead,handleWeirdStringValue(java.lang.Class<?>, java.lang.String, java.lang.String, java.lang.Object...)should be called which will call this method if necessary.- Parameters:
value- String value from input being deserializedinstClass- Type that String should be deserialized intomsgBase- Message that describes specific problem
-
weirdNumberException
Helper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given target type. Note that most of the time this method should NOT be called; instead,handleWeirdNumberValue(java.lang.Class<?>, java.lang.Number, java.lang.String, java.lang.Object...)should be called which will call this method if necessary. -
weirdNativeValueException
Helper method for constructing exception to indicate that input JSON token of type "native value" (seeJsonToken.VALUE_EMBEDDED_OBJECT) is of incompatible type (and there is no delegating creator or such to use) and cannot be used to construct value of specified type (usually POJO). Note that most of the time this method should NOT be called; instead,handleWeirdNativeValue(tools.jackson.databind.JavaType, java.lang.Object, tools.jackson.core.JsonParser)should be called which will call this method -
instantiationException
Helper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor)Note that most of the time this method should NOT be called directly; instead,
handleInstantiationProblem(java.lang.Class<?>, java.lang.Object, java.lang.Throwable)should be called which will call this method if necessary. -
instantiationException
Helper method for constructing instantiation exception for specified type, to indicate that instantiation failed due to missing instantiator (creator; constructor or factory method).Note that most of the time this method should NOT be called; instead,
handleMissingInstantiator(java.lang.Class<?>, tools.jackson.databind.deser.ValueInstantiator, tools.jackson.core.JsonParser, java.lang.String, java.lang.Object...)should be called which will call this method if necessary. -
invalidTypeIdException
Description copied from class:DatabindContextHelper method for constructing exception to indicate that given type id could not be resolved to a valid subtype of specified base type. Most commonly called during polymorphic deserialization.Note that most of the time this method should NOT be called directly: instead, method
handleUnknownTypeId()should be called which will call this method if necessary.- Specified by:
invalidTypeIdExceptionin classDatabindContext
-
missingTypeIdException
-
missingInjectableValueException
public DatabindException missingInjectableValueException(String msg, Object valueId, BeanProperty forProperty, Object beanInstance) -
_getDateFormat
Helper method to get a non-shared instance ofDateFormatwith default configuration; instance is lazily constructed, reused within same instance of context (that is, within same life-cycle ofreadValue()from mapper or reader). Reuse is safe since access will not occur from multiple threads (unless caller somehow manages to share context objects across threads which is not supported). -
_shapeForToken
Helper method for constructing description like "Object value" givenJsonTokenencountered.
-