- All Implemented Interfaces:
NullValueProvider,ValueInstantiator.Gettable
- Direct Known Subclasses:
BeanAsArrayBuilderDeserializer,BeanAsArrayDeserializer,BeanDeserializer,BuilderBasedDeserializer
BeanDeserializer.-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer
ValueDeserializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SettableAnyPropertyFallback setter used for handling any properties that are not mapped to regular setters.protected ValueDeserializer<Object>Deserializer that is used iff array-delegate-based creator is to be used for deserializing from JSON Object.protected final Map<String,SettableBeanProperty> We may also have one or more back reference fields (usually zero or one).protected final BeanPropertyMapMapping of property names to properties, built when all properties to use have been successfully resolved.protected final JavaTypeDeclared type of the bean this deserializer handles.protected ValueDeserializer<Object>Deserializer that is used iff delegate-based creator is to be used for deserializing from JSON Object.protected ExternalTypeHandlerHandler that we need if any of properties uses external type id.In addition to properties that are set, we will also keep track of recognized but ignorable properties: these will be skipped without errors or warnings.protected final booleanFlag that can be set to ignore and skip unknown properties.Keep track of the the properties that needs to be specifically included.protected final ValueInjector[]List ofValueInjectors, if any injectable values are expected by the bean; otherwise null.protected final booleanFlag that indicates that some aspect of deserialization depends on active view used (if any)protected booleanFlag that is set to mark cases where deserialization from Object value using otherwise "standard" property binding will need to use non-default creation method: namely, either "full" delegation (array-delegation does not apply), or properties-based Creator method is used.protected final ObjectIdReaderIf an Object Id is to be used for value handled by this deserializer, this reader is used for handling.protected PropertyBasedCreatorIf the bean needs to be instantiated using constructor or factory method that takes one or more named properties as argument(s), this creator is used for instantiation.protected final JsonFormat.ShapeRequested shape from bean class annotations.protected ConcurrentHashMap<ClassKey,ValueDeserializer<Object>> Lazily constructed map used to contain deserializers needed for polymorphic subtypes.protected UnwrappedPropertyHandlerIf one of properties has "unwrapped" value, we need separate helper objectprotected final ValueInstantiatorObject that handles details of constructing initial bean value (to which bind data to), unless instance is passed (via updateValue())protected booleanFlag that indicates that no "special features" whatsoever are enabled, so the simplest processing is possible.protected static final PropertyNameFields inherited from class tools.jackson.databind.deser.std.StdDeserializer
_valueClass, _valueType, F_MASK_INT_COERCIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedBeanDeserializerBase(BeanDeserializerBase src, boolean ignoreAllUnknown) BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps) protectedBeanDeserializerBase(BeanDeserializerBase src, BeanPropertyMap beanProps) protectedprotectedBeanDeserializerBase(BeanDeserializerBase src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown) Constructor used in cases where unwrapping-with-name-change has been invoked and lookup indices need to be updated.protectedBeanDeserializerBase(BeanDeserializerBuilder builder, BeanDescription.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, Set<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews) Constructor used when initially building a deserializer instance, given aBeanDeserializerBuilderthat contains configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected Object_convertObjectId(JsonParser p, DeserializationContext ctxt, Object rawId, ValueDeserializer<Object> idDeser) Helper method we need to do necessary conversion from whatever native object id type is, into declared type that Jackson internals expect.protected final ValueDeserializer<Object>protected final ValueDeserializer<Object>Alternate to_delegateDeserializer()which will only consider_arrayDelegateDeserializerif givenJsonParserpoints toJsonToken.START_ARRAYtoken.protected abstract Objectprotected ValueDeserializer<Object>Helper method that can be used to see if specified property is annotated to indicate use of a converter for property value (in case of container types, it is container type itself, not key or content type).protected NameTransformerHelper method called to see if given property might be so-called unwrapped property: these require special handling.protected ValueDeserializer<Object>_findSubclassDeserializer(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) Helper method called to (try to) locate deserializer for given sub-type of type that this deserializer handles.protected PropertyMetadata_getSetterInfo(DeserializationContext ctxt, AnnotatedMember accessor, JavaType type) Method essentially copied fromBasicDeserializerFactory, needed to findPropertyMetadatafor Delegating Creator, for access to annotation-derived info.protected BeanDeserializerBase_handleByNameInclusion(DeserializationContext ctxt, AnnotationIntrospector intr, BeanDeserializerBase contextual, AnnotatedMember accessor) protected Object_handleTypedObjectId(JsonParser p, DeserializationContext ctxt, Object pojo, Object rawId) Off-lined method called to handle "native" Object Id that has been read and known to be associated with given deserialized POJO.protected void_replaceProperty(BeanPropertyMap props, SettableBeanProperty[] creatorProps, SettableBeanProperty origProp, SettableBeanProperty newProp) protected SettableBeanPropertyMethod that wraps given property withObjectIdReferencePropertyin case where object id resolution is required.protected SettableBeanPropertyHelper method that will handle gruesome details of dealing with properties that have non-static inner class as value...protected SettableBeanPropertyHelper method called to see if given property is part of 'managed' property pair (managed + back reference), and if so, handle resolution details.protected SettableBeanProperty_resolveMergeAndNullSettings(DeserializationContext ctxt, SettableBeanProperty prop, PropertyMetadata propMetadata) protected abstract BeanDeserializerBaseFluent factory for creating a variant that can handle POJO output as a JSON Array.createContextual(DeserializationContext ctxt, BeanProperty property) Although most of post-processing is done in resolve(), we only get access to referring property's annotations here; and this is needed to support per-property ObjectIds.Accessor for finding properties that represents values to pass through property-based creator method (constructor or factory method)Method called to deserialize POJO value from a JSON boolean value (true, false)Method called to deserialize POJO value from a JSON floating-point number.abstract ObjectGeneral version used when handling needs more advanced features.protected ObjectMethod called in cases where it looks like we got an Object Id to parse and use as a reference.protected Objectprotected ObjectAlternative deserialization method used when we expect to see Object Id; if so, we will need to ensure that the Id is seen before anything else, to ensure that it is available for solving references, even if JSON itself is not ordered that way.deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) Base implementation that does not assume specific type inclusion mechanism.findBackReference(String logicalName) Method needed byBeanDeserializerFactoryto properly link managed- and back-reference pairs.findProperty(int propertyIndex) Alternate find method that tries to locate a property with givenproperty index.protected SettableBeanPropertyfindProperty(String propertyName) Accessor for finding the property with given name, if POJO has one.findProperty(PropertyName propertyName) This method may be called in conjunction with calls toValueDeserializer.getEmptyValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).Method that will either return null to indicate that type being deserializers has no concept of properties; or a collection of identifiers for whichtoStringwill give external property name.This method may be called in conjunction with calls toValueDeserializer.getNullValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.Overridden to return true for those instances that are handling value for which Object Identity handling is enabled (either via value type or referring property).intAccessor for checking number of deserialized properties.Exact structured type this deserializer handles, if known.Class<?>Method for accessing concrete physical type of values this deserializer produces.protected voidhandleIgnoredProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) Method called when an explicitly ignored property (one specified with a name to match, either by property annotation or class annotation) is encountered.protected ObjecthandlePolymorphic(JsonParser p, DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) Method called in cases where we may have polymorphic deserialization case: that is, type of Creator-constructed bean is not the type of deserializer itself.protected ObjecthandleUnknownProperties(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) Method called to handle set of one or more unknown properties, stored in their entirety in givenTokenBuffer(as field entries, name and value).protected voidhandleUnknownProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) Method called when a JSON property is encountered that has not matching setter, any-setter or field, and thus cannot be assigned.protected voidhandleUnknownVanilla(JsonParser p, DeserializationContext ctxt, Object beanOrBuilder, String propName) Helper method called for an unknown property, when using "vanilla" processing.booleanhasProperty(String propertyName) booleanhasViews()protected abstract voidprotected voidinjectValues(DeserializationContext ctxt, Object bean) booleanMethod called to see if deserializer instance is cachable and usable for other properties of same type (type for which instance was created).booleanAccessor for checking whether this deserializer is operating in case-insensitive manner.Method for accessing logical type of values this deserializer produces.Accessor for iterating over properties this deserializer uses; with the exception that properties passed via Creator methods (specifically, "property-based constructor") are not included, but can be accessed separate by callingcreatorProperties()voidMethod called to finalize setup of this deserializer, after deserializer itself has been registered.supportsUpdate(DeserializationConfig config) Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not.abstract ValueDeserializer<Object>unwrappingDeserializer(DeserializationContext ctxt, NameTransformer unwrapper) Method that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.abstract BeanDeserializerBasewithByNameInclusion(Set<String> ignorableProps, Set<String> includableProps) abstract BeanDeserializerBasewithIgnoreAllUnknown(boolean ignoreUnknown) abstract BeanDeserializerBasewrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) Method that will modify caught exception (passed in as argument) as necessary to include reference information, and to ensure it is a subtype ofDatabindException, or an unchecked exception.protected ObjectMethods inherited from class tools.jackson.databind.deser.std.StdDeserializer
_byteOverflow, _checkBooleanToStringCoercion, _checkCoercionFail, _checkDoubleSpecialValue, _checkFloatSpecialValue, _checkFloatToIntCoercion, _checkFloatToStringCoercion, _checkFromStringCoercion, _checkFromStringCoercion, _checkIntToFloatCoercion, _checkIntToStringCoercion, _checkTextualNull, _checkToStringCoercion, _coerceBooleanFromInt, _coercedTypeDesc, _coercedTypeDesc, _coerceIntegral, _deserializeFromArray, _deserializeFromEmptyString, _deserializeFromString, _deserializeWrappedValue, _findCoercionFromBlankString, _findCoercionFromEmptyArray, _findCoercionFromEmptyString, _findNullProvider, _hasTextualNull, _intOverflow, _isBlank, _isFalse, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _isTrue, _neitherNull, _nonNullNumber, _parseBoolean, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDouble, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseInteger, _parseInteger, _parseIntPrimitive, _parseIntPrimitive, _parseLong, _parseLong, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _wrapIOFailure, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueType, handleMissingEndArrayForSingle, handleNestedArrayForSingle, isDefaultDeserializer, isDefaultKeyDeserializerMethods inherited from class tools.jackson.databind.ValueDeserializer
deserialize, deserialize, deserializeWithType, getAbsentValue, getDelegatee, getNullValue, replaceDelegatee
-
Field Details
-
TEMP_PROPERTY_NAME
-
_beanType
Declared type of the bean this deserializer handles. -
_serializationShape
Requested shape from bean class annotations. -
_valueInstantiator
Object that handles details of constructing initial bean value (to which bind data to), unless instance is passed (via updateValue()) -
_delegateDeserializer
Deserializer that is used iff delegate-based creator is to be used for deserializing from JSON Object.NOTE: cannot be
finalbecause we need to get it duringresolve()method (and not contextualization). -
_arrayDelegateDeserializer
Deserializer that is used iff array-delegate-based creator is to be used for deserializing from JSON Object.NOTE: cannot be
finalbecause we need to get it duringresolve()method (and not contextualization). -
_propertyBasedCreator
If the bean needs to be instantiated using constructor or factory method that takes one or more named properties as argument(s), this creator is used for instantiation. This value gets resolved during general resolution. -
_nonStandardCreation
protected boolean _nonStandardCreationFlag that is set to mark cases where deserialization from Object value using otherwise "standard" property binding will need to use non-default creation method: namely, either "full" delegation (array-delegation does not apply), or properties-based Creator method is used.Note that flag is somewhat mis-named as it is not affected by scalar-delegating creators; it only has effect on Object Value binding.
-
_vanillaProcessing
protected boolean _vanillaProcessingFlag that indicates that no "special features" whatsoever are enabled, so the simplest processing is possible. -
_beanProperties
Mapping of property names to properties, built when all properties to use have been successfully resolved. -
_injectables
List ofValueInjectors, if any injectable values are expected by the bean; otherwise null. This includes injectors used for injecting values via setters and fields, but not ones passed through constructor parameters. -
_anySetter
Fallback setter used for handling any properties that are not mapped to regular setters. If setter is not null, it will be called once for each such property. -
_ignorableProps
In addition to properties that are set, we will also keep track of recognized but ignorable properties: these will be skipped without errors or warnings. -
_includableProps
Keep track of the the properties that needs to be specifically included. -
_ignoreAllUnknown
protected final boolean _ignoreAllUnknownFlag that can be set to ignore and skip unknown properties. If set, will not throw an exception for unknown properties. -
_needViewProcesing
protected final boolean _needViewProcesingFlag that indicates that some aspect of deserialization depends on active view used (if any) -
_backRefs
We may also have one or more back reference fields (usually zero or one). -
_subDeserializers
Lazily constructed map used to contain deserializers needed for polymorphic subtypes. Note that this is only needed for polymorphic types, that is, when the actual type is not statically known. For other types this remains null. -
_unwrappedPropertyHandler
If one of properties has "unwrapped" value, we need separate helper object -
_externalTypeIdHandler
Handler that we need if any of properties uses external type id. -
_objectIdReader
If an Object Id is to be used for value handled by this deserializer, this reader is used for handling.
-
-
Constructor Details
-
BeanDeserializerBase
protected BeanDeserializerBase(BeanDeserializerBuilder builder, BeanDescription.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, Set<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews) Constructor used when initially building a deserializer instance, given aBeanDeserializerBuilderthat contains configuration. -
BeanDeserializerBase
-
BeanDeserializerBase
-
BeanDeserializerBase
protected BeanDeserializerBase(BeanDeserializerBase src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown) Constructor used in cases where unwrapping-with-name-change has been invoked and lookup indices need to be updated. -
BeanDeserializerBase
-
BeanDeserializerBase
public BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps) - Since:
- 2.12
-
BeanDeserializerBase
-
-
Method Details
-
withObjectIdReader
-
withByNameInclusion
public abstract BeanDeserializerBase withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps) -
withIgnoreAllUnknown
-
withBeanProperties
Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems. -
unwrappingDeserializer
public abstract ValueDeserializer<Object> unwrappingDeserializer(DeserializationContext ctxt, NameTransformer unwrapper) Description copied from class:ValueDeserializerMethod that will return deserializer instance that is able to handle "unwrapped" value instances If no unwrapped instance can be constructed, will simply return this object as-is.Default implementation just returns 'this' indicating that no unwrapped variant exists
- Overrides:
unwrappingDeserializerin classValueDeserializer<Object>
-
asArrayDeserializer
Fluent factory for creating a variant that can handle POJO output as a JSON Array. Implementations may ignore this request if no such input is possible. -
initNameMatcher
-
resolve
Method called to finalize setup of this deserializer, after deserializer itself has been registered. This is needed to handle recursive and transitive dependencies.- Overrides:
resolvein classValueDeserializer<Object>- Parameters:
ctxt- Context to use for accessing configuration, resolving secondary deserializers
-
_replaceProperty
protected void _replaceProperty(BeanPropertyMap props, SettableBeanProperty[] creatorProps, SettableBeanProperty origProp, SettableBeanProperty newProp) -
_getSetterInfo
protected PropertyMetadata _getSetterInfo(DeserializationContext ctxt, AnnotatedMember accessor, JavaType type) Method essentially copied fromBasicDeserializerFactory, needed to findPropertyMetadatafor Delegating Creator, for access to annotation-derived info. -
_findConvertingDeserializer
protected ValueDeserializer<Object> _findConvertingDeserializer(DeserializationContext ctxt, SettableBeanProperty prop) Helper method that can be used to see if specified property is annotated to indicate use of a converter for property value (in case of container types, it is container type itself, not key or content type).NOTE: returned deserializer is NOT yet contextualized, caller needs to take care to do that.
-
createContextual
Although most of post-processing is done in resolve(), we only get access to referring property's annotations here; and this is needed to support per-property ObjectIds. We will also consider Shape transformations (read from Array) at this point, since it may come from either Class definition or property.- Overrides:
createContextualin classValueDeserializer<Object>- Parameters:
ctxt- Deserialization context to access configuration, additional deserializers that may be needed by this deserializerproperty- Method, field or constructor parameter that represents the property (and is used to assign deserialized value). Should be available; but there may be cases where caller cannot provide it and null is passed instead (in which case impls usually pass 'this' deserializer as is)- Returns:
- Deserializer to use for deserializing values of specified property; may be this instance or a new instance.
-
_handleByNameInclusion
protected BeanDeserializerBase _handleByNameInclusion(DeserializationContext ctxt, AnnotationIntrospector intr, BeanDeserializerBase contextual, AnnotatedMember accessor) -
_resolveManagedReferenceProperty
protected SettableBeanProperty _resolveManagedReferenceProperty(DeserializationContext ctxt, SettableBeanProperty prop) Helper method called to see if given property is part of 'managed' property pair (managed + back reference), and if so, handle resolution details. -
_resolvedObjectIdProperty
protected SettableBeanProperty _resolvedObjectIdProperty(DeserializationContext ctxt, SettableBeanProperty prop) Method that wraps given property withObjectIdReferencePropertyin case where object id resolution is required. -
_findPropertyUnwrapper
protected NameTransformer _findPropertyUnwrapper(DeserializationContext ctxt, SettableBeanProperty prop) Helper method called to see if given property might be so-called unwrapped property: these require special handling. -
_resolveInnerClassValuedProperty
protected SettableBeanProperty _resolveInnerClassValuedProperty(DeserializationContext ctxt, SettableBeanProperty prop) Helper method that will handle gruesome details of dealing with properties that have non-static inner class as value... -
_resolveMergeAndNullSettings
protected SettableBeanProperty _resolveMergeAndNullSettings(DeserializationContext ctxt, SettableBeanProperty prop, PropertyMetadata propMetadata) -
getNullAccessPattern
Description copied from class:ValueDeserializerThis method may be called in conjunction with calls toValueDeserializer.getNullValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.Default implementation indicates that the "null value" to use for input null does not vary across uses so that
ValueDeserializer.getNullValue(DeserializationContext)need not be called more than once per deserializer instance. This information may be used as optimization.- Specified by:
getNullAccessPatternin interfaceNullValueProvider- Overrides:
getNullAccessPatternin classValueDeserializer<Object>
-
getEmptyAccessPattern
Description copied from class:ValueDeserializerThis method may be called in conjunction with calls toValueDeserializer.getEmptyValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.- Overrides:
getEmptyAccessPatternin classValueDeserializer<Object>
-
getEmptyValue
Description copied from class:ValueDeserializerMethod called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings). Usually this is same asValueDeserializer.getNullValue(tools.jackson.databind.DeserializationContext)(which in turn is usually simply Java null), but it can be overridden for specific types. Or, if type should never be converted from empty String, method can also throw an exception.This method may be called once, or multiple times, depending on what
ValueDeserializer.getEmptyAccessPattern()returns.Default implementation simply calls
ValueDeserializer.getNullValue(tools.jackson.databind.DeserializationContext)and returns value.- Overrides:
getEmptyValuein classValueDeserializer<Object>- Throws:
JacksonException
-
isCachable
public boolean isCachable()Description copied from class:ValueDeserializerMethod called to see if deserializer instance is cachable and usable for other properties of same type (type for which instance was created).Note that cached instances are still contextualized on per-property basis (but note that
ValueDeserializer.resolve(DeserializationContext)d just once!) This means that in most cases it is safe to cache instances; however, it only makes sense to cache instances if instantiation is expensive, or if instances are heavy-weight.Default implementation returns false, to indicate that no caching is done.
- Overrides:
isCachablein classValueDeserializer<Object>
-
isCaseInsensitive
public boolean isCaseInsensitive()Accessor for checking whether this deserializer is operating in case-insensitive manner.- Returns:
- True if this deserializer should match property names without considering casing; false if case has to match exactly.
- Since:
- 2.12
-
supportsUpdate
Description copied from class:ValueDeserializerIntrospection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. Return value should either beBoolean.FALSEif update is not supported at all (immutable values);Boolean.TRUEif update should usually work (regular POJOs, for example), ornullif this is either not known, or may sometimes work.Information gathered is typically used to either prevent merging update for property (either by skipping, if based on global defaults; or by exception during deserializer construction if explicit attempt made) if
Boolean.FALSEreturned, or inclusion ifBoolean.TRUEis specified. If "unknown" case (nullreturned) behavior is to exclude property if global defaults used; or to allow if explicit per-type or property merging is defined.Default implementation returns
nullto allow explicit per-type or per-property attempts.- Overrides:
supportsUpdatein classValueDeserializer<Object>
-
handledType
Description copied from class:ValueDeserializerMethod for accessing concrete physical type of values this deserializer produces. Note that this information is not guaranteed to be exact -- it may be a more generic (super-type) -- but it should not be incorrect (return a non-related type).Default implementation will return null, which means almost same same as returning
Object.classwould; that is, that nothing is known about handled type.- Overrides:
handledTypein classStdDeserializer<Object>- Returns:
- Physical type of values this deserializer produces, if known;
nullif not
-
getObjectIdReader
Overridden to return true for those instances that are handling value for which Object Identity handling is enabled (either via value type or referring property).- Overrides:
getObjectIdReaderin classValueDeserializer<Object>- Returns:
- ObjectIdReader used for resolving possible Object Identifier value, instead of full value serialization, if deserializer can do that; null if no Object Id is expected.
-
hasProperty
-
hasViews
public boolean hasViews() -
getPropertyCount
public int getPropertyCount()Accessor for checking number of deserialized properties. -
getKnownPropertyNames
Description copied from class:ValueDeserializerMethod that will either return null to indicate that type being deserializers has no concept of properties; or a collection of identifiers for whichtoStringwill give external property name. This is only to be used for error reporting and diagnostics purposes (most commonly, to accompany "unknown property" exception).- Overrides:
getKnownPropertyNamesin classValueDeserializer<Object>
-
getValueType
Description copied from class:StdDeserializerExact structured type this deserializer handles, if known.- Overrides:
getValueTypein classStdDeserializer<Object>
-
logicalType
Description copied from class:ValueDeserializerMethod for accessing logical type of values this deserializer produces. Typically used for further configuring handling of values, for example, to find which coercions are legal.- Overrides:
logicalTypein classValueDeserializer<Object>- Returns:
- Logical type of values this deserializer produces, if known;
nullif not
-
properties
Accessor for iterating over properties this deserializer uses; with the exception that properties passed via Creator methods (specifically, "property-based constructor") are not included, but can be accessed separate by callingcreatorProperties() -
creatorProperties
Accessor for finding properties that represents values to pass through property-based creator method (constructor or factory method) -
findProperty
-
findProperty
Accessor for finding the property with given name, if POJO has one. Name used is the external name, i.e. name used in external data representation (JSON). -
findProperty
Alternate find method that tries to locate a property with givenproperty index. Note that access by index is not necessarily faster than by name, since properties are not directly indexable; however, for most instances difference is not significant as number of properties is low. -
findBackReference
Method needed byBeanDeserializerFactoryto properly link managed- and back-reference pairs.- Overrides:
findBackReferencein classValueDeserializer<Object>
-
getValueInstantiator
- Specified by:
getValueInstantiatorin interfaceValueInstantiator.Gettable- Overrides:
getValueInstantiatorin classStdDeserializer<Object>
-
deserializeFromObject
public abstract Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws JacksonException General version used when handling needs more advanced features.- Throws:
JacksonException
-
deserializeWithType
public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws JacksonException Description copied from class:StdDeserializerBase implementation that does not assume specific type inclusion mechanism. Sub-classes are expected to override this method if they are to handle type information.- Overrides:
deserializeWithTypein classStdDeserializer<Object>typeDeserializer- Deserializer to use for handling type information- Throws:
JacksonException
-
_handleTypedObjectId
protected Object _handleTypedObjectId(JsonParser p, DeserializationContext ctxt, Object pojo, Object rawId) throws JacksonException Off-lined method called to handle "native" Object Id that has been read and known to be associated with given deserialized POJO.- Throws:
JacksonException
-
_convertObjectId
protected Object _convertObjectId(JsonParser p, DeserializationContext ctxt, Object rawId, ValueDeserializer<Object> idDeser) throws JacksonException Helper method we need to do necessary conversion from whatever native object id type is, into declared type that Jackson internals expect. This may be simple cast (for String ids), or something more complicated; in latter case we may need to create bogus content buffer to allow use of id deserializer.- Throws:
JacksonException
-
deserializeWithObjectId
protected Object deserializeWithObjectId(JsonParser p, DeserializationContext ctxt) throws JacksonException Alternative deserialization method used when we expect to see Object Id; if so, we will need to ensure that the Id is seen before anything else, to ensure that it is available for solving references, even if JSON itself is not ordered that way. This may require buffering in some cases, but usually just a simple lookup to ensure that ordering is correct.- Throws:
JacksonException
-
deserializeFromObjectId
protected Object deserializeFromObjectId(JsonParser p, DeserializationContext ctxt) throws JacksonException Method called in cases where it looks like we got an Object Id to parse and use as a reference.- Throws:
JacksonException
-
deserializeFromObjectUsingNonDefault
protected Object deserializeFromObjectUsingNonDefault(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
_deserializeUsingPropertyBased
protected abstract Object _deserializeUsingPropertyBased(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
deserializeFromNumber
public Object deserializeFromNumber(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
deserializeFromString
public Object deserializeFromString(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
deserializeFromDouble
public Object deserializeFromDouble(JsonParser p, DeserializationContext ctxt) throws JacksonException Method called to deserialize POJO value from a JSON floating-point number.- Throws:
JacksonException
-
deserializeFromBoolean
public Object deserializeFromBoolean(JsonParser p, DeserializationContext ctxt) throws JacksonException Method called to deserialize POJO value from a JSON boolean value (true, false)- Throws:
JacksonException
-
deserializeFromEmbedded
public Object deserializeFromEmbedded(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
_delegateDeserializer
-
_delegateDeserializer
Alternate to_delegateDeserializer()which will only consider_arrayDelegateDeserializerif givenJsonParserpoints toJsonToken.START_ARRAYtoken. -
injectValues
- Throws:
JacksonException
-
handleUnknownProperties
protected Object handleUnknownProperties(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws JacksonException Method called to handle set of one or more unknown properties, stored in their entirety in givenTokenBuffer(as field entries, name and value).- Throws:
JacksonException
-
handleUnknownVanilla
protected void handleUnknownVanilla(JsonParser p, DeserializationContext ctxt, Object beanOrBuilder, String propName) throws JacksonException Helper method called for an unknown property, when using "vanilla" processing.- Parameters:
beanOrBuilder- Either POJO instance (if constructed), or builder (in case of builder-based approach), that has property we haven't been able to handle yet.- Throws:
JacksonException
-
handleUnknownProperty
protected void handleUnknownProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) throws JacksonException Method called when a JSON property is encountered that has not matching setter, any-setter or field, and thus cannot be assigned.- Overrides:
handleUnknownPropertyin classStdDeserializer<Object>- Parameters:
p- Parser that points to value of the unknown propertyctxt- Context for deserialization; allows access to the parser, error reporting functionalitybeanOrClass- Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is whatStdDeserializer.handledType()returns.propName- Name of the property that cannot be mapped- Throws:
JacksonException
-
handleIgnoredProperty
protected void handleIgnoredProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) throws JacksonException Method called when an explicitly ignored property (one specified with a name to match, either by property annotation or class annotation) is encountered.- Throws:
JacksonException
-
handlePolymorphic
protected Object handlePolymorphic(JsonParser p, DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws JacksonException Method called in cases where we may have polymorphic deserialization case: that is, type of Creator-constructed bean is not the type of deserializer itself. It should be a sub-class or implementation class; either way, we may have more specific deserializer to use for handling it.- Parameters:
p- (optional) If not null, parser that has more properties to handle (in addition to buffered properties); if null, all properties are passed in buffer- Throws:
JacksonException
-
_findSubclassDeserializer
protected ValueDeserializer<Object> _findSubclassDeserializer(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws JacksonException Helper method called to (try to) locate deserializer for given sub-type of type that this deserializer handles.- Throws:
JacksonException
-
wrapAndThrow
public DatabindException wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) Method that will modify caught exception (passed in as argument) as necessary to include reference information, and to ensure it is a subtype ofDatabindException, or an unchecked exception.Rules for wrapping and unwrapping are bit complicated; essentially:
- Errors are to be passed as is (if uncovered via unwrapping)
JacksonExceptionare to be passed as is
DatabindExceptionin order to allow callers to invoke method asthrow wrapAndThrow(...);thereby ensuring complete code coverage is possible. This also ensures that all call paths within this method throw an exception; otherwise they would be required to return. -
wrapInstantiationProblem
protected Object wrapInstantiationProblem(DeserializationContext ctxt, Throwable t) throws JacksonException - Throws:
JacksonException
-