java.lang.Object
tools.jackson.databind.ValueDeserializer<T>
tools.jackson.databind.deser.std.StdDeserializer<Object>
tools.jackson.databind.deser.bean.BeanDeserializerBase
tools.jackson.databind.deser.bean.BeanDeserializer
- All Implemented Interfaces:
NullValueProvider,ValueInstantiator.Gettable
- Direct Known Subclasses:
ThrowableDeserializer
Deserializer class that can deserialize instances of
arbitrary bean objects, usually from JSON Object structs,
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer
ValueDeserializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected NameTransformerState marker we need in order to avoid infinite recursion for some cases (not very clean, alas, but has to do for now)protected PropertyNameMatcherprotected SettableBeanProperty[]Fields inherited from class tools.jackson.databind.deser.bean.BeanDeserializerBase
_anySetter, _arrayDelegateDeserializer, _backRefs, _beanProperties, _beanType, _delegateDeserializer, _externalTypeIdHandler, _ignorableProps, _ignoreAllUnknown, _includableProps, _injectables, _needViewProcesing, _nonStandardCreation, _objectIdReader, _propertyBasedCreator, _serializationShape, _subDeserializers, _unwrappedPropertyHandler, _valueInstantiator, _vanillaProcessing, TEMP_PROPERTY_NAMEFields inherited from class tools.jackson.databind.deser.std.StdDeserializer
_valueClass, _valueType, F_MASK_INT_COERCIONS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCopy-constructor that can be used by sub-classes to allow copy-on-write style copying of settings of an existing instance.protectedBeanDeserializer(BeanDeserializer src, boolean ignoreAllUnknown) protectedBeanDeserializer(BeanDeserializer src, Set<String> ignorableProps, Set<String> includableProps) protectedBeanDeserializer(BeanDeserializer src, BeanPropertyMap props) protectedBeanDeserializer(BeanDeserializer src, ObjectIdReader oir) protectedBeanDeserializer(BeanDeserializer src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown) BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews) Constructor used byBeanDeserializerBuilder. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectHelper method that allows easy support for array-related coercion features: checks for either empty array, or single-value array-wrapped value (if coercion enabled byCoercionConfigs(since 2.12), and either reports an exception (if no coercion allowed), or returns appropriate result value using coercion mechanism indicated.protected final Object_deserializeOther(JsonParser p, DeserializationContext ctxt, JsonToken t) protected ObjectMethod called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters.protected final Objectprotected Object_deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean, ExternalTypeHandler ext) protected void_handleNullFromPropsBasedCreator(JsonParser p, DeserializationContext ctxt, TokenBuffer unknown, List<tools.jackson.databind.deser.bean.BeanDeserializer.BeanReferring> referrings) protected Object_handleUnexpectedWithin(JsonParser p, DeserializationContext ctxt, Object bean) Method called if an unexpected token (other thenJsonToken.PROPERTY_NAME) is found after POJO has been instantiated and partially bound.protected BeanDeserializerBaseFluent factory for creating a variant that can handle POJO output as a JSON Array.deserialize(JsonParser p, DeserializationContext ctxt) Main deserialization method for bean-based objects (POJOs).deserialize(JsonParser p, DeserializationContext ctxt, Object bean) Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.protected ObjectHelper method called for rare case of pointing toJsonToken.VALUE_NULLtoken.General version used when handling needs more advanced features.protected Objectprotected Objectprotected Objectprotected ObjectdeserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean) protected ObjectMethod called when there are declared "unwrapped" properties which need special handlingprotected ObjectdeserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt, Object bean) protected final ObjectdeserializeWithView(JsonParser p, DeserializationContext ctxt, Object bean, Class<?> activeView) protected voidunwrappingDeserializer(DeserializationContext ctxt, NameTransformer transformer) 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.withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps) withIgnoreAllUnknown(boolean ignoreUnknown) Methods inherited from class tools.jackson.databind.deser.bean.BeanDeserializerBase
_convertObjectId, _delegateDeserializer, _delegateDeserializer, _findConvertingDeserializer, _findPropertyUnwrapper, _findSubclassDeserializer, _getSetterInfo, _handleByNameInclusion, _handleTypedObjectId, _replaceProperty, _resolvedObjectIdProperty, _resolveInnerClassValuedProperty, _resolveManagedReferenceProperty, _resolveMergeAndNullSettings, createContextual, creatorProperties, deserializeFromBoolean, deserializeFromDouble, deserializeFromEmbedded, deserializeFromNumber, deserializeFromObjectId, deserializeFromObjectUsingNonDefault, deserializeFromString, deserializeWithObjectId, deserializeWithType, findBackReference, findProperty, findProperty, findProperty, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getObjectIdReader, getPropertyCount, getValueInstantiator, getValueType, handledType, handleIgnoredProperty, handlePolymorphic, handleUnknownProperties, handleUnknownProperty, handleUnknownVanilla, hasProperty, hasViews, injectValues, isCachable, isCaseInsensitive, logicalType, properties, resolve, supportsUpdate, wrapAndThrow, wrapInstantiationProblemMethods 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, _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
deserializeWithType, getAbsentValue, getDelegatee, getNullValue, replaceDelegatee
-
Field Details
-
_propNameMatcher
-
_propsByIndex
-
_currentlyTransforming
State marker we need in order to avoid infinite recursion for some cases (not very clean, alas, but has to do for now)
-
-
Constructor Details
-
BeanDeserializer
public BeanDeserializer(BeanDeserializerBuilder builder, BeanDescription.Supplier beanDescRef, BeanPropertyMap properties, Map<String, SettableBeanProperty> backRefs, HashSet<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews) Constructor used byBeanDeserializerBuilder. -
BeanDeserializer
Copy-constructor that can be used by sub-classes to allow copy-on-write style copying of settings of an existing instance. -
BeanDeserializer
-
BeanDeserializer
protected BeanDeserializer(BeanDeserializer src, UnwrappedPropertyHandler unwrapHandler, PropertyBasedCreator propertyBasedCreator, BeanPropertyMap renamedProperties, boolean ignoreAllUnknown) -
BeanDeserializer
-
BeanDeserializer
protected BeanDeserializer(BeanDeserializer src, Set<String> ignorableProps, Set<String> includableProps) -
BeanDeserializer
-
-
Method Details
-
unwrappingDeserializer
public ValueDeserializer<Object> unwrappingDeserializer(DeserializationContext ctxt, NameTransformer transformer) 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
- Specified by:
unwrappingDeserializerin classBeanDeserializerBase
-
withObjectIdReader
- Specified by:
withObjectIdReaderin classBeanDeserializerBase
-
withByNameInclusion
public BeanDeserializer withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps) - Specified by:
withByNameInclusionin classBeanDeserializerBase
-
withIgnoreAllUnknown
- Specified by:
withIgnoreAllUnknownin classBeanDeserializerBase
-
withBeanProperties
Description copied from class:BeanDeserializerBaseMutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.- Overrides:
withBeanPropertiesin classBeanDeserializerBase
-
asArrayDeserializer
Description copied from class:BeanDeserializerBaseFluent 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.- Specified by:
asArrayDeserializerin classBeanDeserializerBase
-
initNameMatcher
- Specified by:
initNameMatcherin classBeanDeserializerBase
-
deserialize
Main deserialization method for bean-based objects (POJOs).- Specified by:
deserializein classValueDeserializer<Object>- Parameters:
p- Parser used for reading JSON contentctxt- Context that can be used to access information about this deserialization activity.- Returns:
- Deserialized value
- Throws:
JacksonException
-
_deserializeOther
protected final Object _deserializeOther(JsonParser p, DeserializationContext ctxt, JsonToken t) throws JacksonException - Throws:
JacksonException
-
deserialize
public Object deserialize(JsonParser p, DeserializationContext ctxt, Object bean) throws JacksonException Secondary deserialization method, called in cases where POJO instance is created as part of deserialization, potentially after collecting some or all of the properties to set.- Overrides:
deserializein classValueDeserializer<Object>- Throws:
JacksonException
-
deserializeFromObject
public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws JacksonException General version used when handling needs more advanced features.- Specified by:
deserializeFromObjectin classBeanDeserializerBase- Throws:
JacksonException
-
_deserializeUsingPropertyBased
protected Object _deserializeUsingPropertyBased(JsonParser p, DeserializationContext ctxt) throws JacksonException Method called to deserialize bean using "property-based creator": this means that a non-default constructor or factory method is called, and then possibly other setters. The trick is that values for creator method need to be buffered, first; and due to non-guaranteed ordering possibly some other properties as well.- Specified by:
_deserializeUsingPropertyBasedin classBeanDeserializerBase- Throws:
JacksonException
-
_deserializeWithErrorWrapping
protected final Object _deserializeWithErrorWrapping(JsonParser p, DeserializationContext ctxt, SettableBeanProperty prop) throws DatabindException - Throws:
DatabindException
-
deserializeFromNull
protected Object deserializeFromNull(JsonParser p, DeserializationContext ctxt) throws JacksonException Helper method called for rare case of pointing toJsonToken.VALUE_NULLtoken. While this is most often an erroneous condition, there is one specific case with XML handling where polymorphic type with no properties is exposed as such, and should be handled same as empty Object.- Throws:
JacksonException
-
_deserializeFromArray
protected Object _deserializeFromArray(JsonParser p, DeserializationContext ctxt) throws JacksonException Description copied from class:StdDeserializerHelper method that allows easy support for array-related coercion features: checks for either empty array, or single-value array-wrapped value (if coercion enabled byCoercionConfigs(since 2.12), and either reports an exception (if no coercion allowed), or returns appropriate result value using coercion mechanism indicated.This method should NOT be called if Array representation is explicitly supported for type: it should only be called in case it is otherwise unrecognized.
NOTE: in case of unwrapped single element, will handle actual decoding by calling
StdDeserializer._deserializeWrappedValue(tools.jackson.core.JsonParser, tools.jackson.databind.DeserializationContext), which by default callsValueDeserializer.deserialize(JsonParser, DeserializationContext).- Overrides:
_deserializeFromArrayin classStdDeserializer<Object>- Throws:
JacksonException
-
deserializeWithView
protected final Object deserializeWithView(JsonParser p, DeserializationContext ctxt, Object bean, Class<?> activeView) throws JacksonException - Throws:
JacksonException
-
deserializeWithUnwrapped
protected Object deserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt) throws JacksonException Method called when there are declared "unwrapped" properties which need special handling- Throws:
JacksonException
-
deserializeWithUnwrapped
protected Object deserializeWithUnwrapped(JsonParser p, DeserializationContext ctxt, Object bean) throws JacksonException - Throws:
JacksonException
-
deserializeUsingPropertyBasedWithUnwrapped
protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
deserializeWithExternalTypeId
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
deserializeWithExternalTypeId
protected Object deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean) throws JacksonException - Throws:
JacksonException
-
_deserializeWithExternalTypeId
protected Object _deserializeWithExternalTypeId(JsonParser p, DeserializationContext ctxt, Object bean, ExternalTypeHandler ext) throws JacksonException - Throws:
JacksonException
-
deserializeUsingPropertyBasedWithExternalTypeId
protected Object deserializeUsingPropertyBasedWithExternalTypeId(JsonParser p, DeserializationContext ctxt) throws JacksonException - Throws:
JacksonException
-
_handleNullFromPropsBasedCreator
protected void _handleNullFromPropsBasedCreator(JsonParser p, DeserializationContext ctxt, TokenBuffer unknown, List<tools.jackson.databind.deser.bean.BeanDeserializer.BeanReferring> referrings) -
_handleUnexpectedWithin
protected Object _handleUnexpectedWithin(JsonParser p, DeserializationContext ctxt, Object bean) throws JacksonException Method called if an unexpected token (other thenJsonToken.PROPERTY_NAME) is found after POJO has been instantiated and partially bound.- Throws:
JacksonException- Since:
- 3.0
-