public abstract class BeanDeserializerBase extends StdDeserializer<Object> implements ContextualDeserializer, ResolvableDeserializer, ValueInstantiator.Gettable, Serializable
BeanDeserializer
.JsonDeserializer.None
Modifier and Type | Field and Description |
---|---|
protected SettableAnyProperty |
_anySetter
Fallback setter used for handling any properties that are not
mapped to regular setters.
|
protected JsonDeserializer<Object> |
_arrayDelegateDeserializer
Deserializer that is used iff array-delegate-based creator
is to be used for deserializing from JSON Object.
|
protected Map<String,SettableBeanProperty> |
_backRefs
We may also have one or more back reference fields (usually
zero or one).
|
protected BeanPropertyMap |
_beanProperties
Mapping of property names to properties, built when all properties
to use have been successfully resolved.
|
protected JavaType |
_beanType
Declared type of the bean this deserializer handles.
|
protected JsonDeserializer<Object> |
_delegateDeserializer
Deserializer that is used iff delegate-based creator is
to be used for deserializing from JSON Object.
|
protected ExternalTypeHandler |
_externalTypeIdHandler
Handler that we need iff any of properties uses external
type id.
|
protected Set<String> |
_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.
|
protected boolean |
_ignoreAllUnknown
Flag that can be set to ignore and skip unknown properties.
|
protected Set<String> |
_includableProps
Keep track of the the properties that needs to be specifically included.
|
protected ValueInjector[] |
_injectables
List of
ValueInjector s, if any injectable values are
expected by the bean; otherwise null. |
protected boolean |
_needViewProcesing
Flag that indicates that some aspect of deserialization depends
on active view used (if any)
|
protected boolean |
_nonStandardCreation
Flag 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 ObjectIdReader |
_objectIdReader
If an Object Id is to be used for value handled by this
deserializer, this reader is used for handling.
|
protected PropertyBasedCreator |
_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.
|
protected JsonFormat.Shape |
_serializationShape
Requested shape from bean class annotations.
|
protected HashMap<ClassKey,JsonDeserializer<Object>> |
_subDeserializers
Lazily constructed map used to contain deserializers needed
for polymorphic subtypes.
|
protected UnwrappedPropertyHandler |
_unwrappedPropertyHandler
If one of properties has "unwrapped" value, we need separate
helper object
|
protected ValueInstantiator |
_valueInstantiator
Object that handles details of constructing initial
bean value (to which bind data to), unless instance
is passed (via updateValue())
|
protected boolean |
_vanillaProcessing
Flag that indicates that no "special features" whatsoever
are enabled, so the simplest processing is possible.
|
protected static PropertyName |
TEMP_PROPERTY_NAME |
_valueClass, _valueType, F_MASK_ACCEPT_ARRAYS, F_MASK_INT_COERCIONS
Modifier | Constructor and Description |
---|---|
protected |
BeanDeserializerBase(BeanDeserializerBase src) |
protected |
BeanDeserializerBase(BeanDeserializerBase src,
BeanPropertyMap beanProps) |
protected |
BeanDeserializerBase(BeanDeserializerBase src,
boolean ignoreAllUnknown) |
protected |
BeanDeserializerBase(BeanDeserializerBase src,
NameTransformer unwrapper) |
|
BeanDeserializerBase(BeanDeserializerBase src,
ObjectIdReader oir) |
protected |
BeanDeserializerBase(BeanDeserializerBase src,
Set<String> ignorableProps)
Deprecated.
|
|
BeanDeserializerBase(BeanDeserializerBase src,
Set<String> ignorableProps,
Set<String> includableProps) |
protected |
BeanDeserializerBase(BeanDeserializerBuilder builder,
BeanDescription beanDesc,
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 a
BeanDeserializerBuilder that
contains configuration. |
Modifier and Type | Method and Description |
---|---|
protected Object |
_convertObjectId(JsonParser p,
DeserializationContext ctxt,
Object rawId,
JsonDeserializer<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 JsonDeserializer<Object> |
_delegateDeserializer() |
protected abstract Object |
_deserializeUsingPropertyBased(JsonParser p,
DeserializationContext ctxt) |
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.
|
protected JsonDeserializer<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 BeanDeserializerBase |
_handleByNameInclusion(DeserializationContext ctxt,
AnnotationIntrospector intr,
BeanDeserializerBase contextual,
AnnotatedMember accessor) |
protected Object |
_handleTypedObjectId(JsonParser p,
DeserializationContext ctxt,
Object pojo,
Object rawId)
Offlined 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 SettableBeanProperty |
_resolvedObjectIdProperty(DeserializationContext ctxt,
SettableBeanProperty prop)
Method that wraps given property with
ObjectIdReferenceProperty
in case where object id resolution is required. |
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...
|
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.
|
protected SettableBeanProperty |
_resolveMergeAndNullSettings(DeserializationContext ctxt,
SettableBeanProperty prop,
PropertyMetadata propMetadata) |
protected abstract BeanDeserializerBase |
asArrayDeserializer()
Fluent factory for creating a variant that can handle
POJO output as a JSON Array.
|
JsonDeserializer<?> |
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.
|
Iterator<SettableBeanProperty> |
creatorProperties()
Accessor for finding properties that represents values to pass
through property-based creator method (constructor or
factory method)
|
Object |
deserializeFromArray(JsonParser p,
DeserializationContext ctxt)
Deprecated.
Since 2.11 Should not be used: was never meant to be called by
code other than sub-classes (implementations), and implementations details
differ
|
Object |
deserializeFromBoolean(JsonParser p,
DeserializationContext ctxt)
Method called to deserialize POJO value from a JSON boolean value (true, false)
|
Object |
deserializeFromDouble(JsonParser p,
DeserializationContext ctxt)
Method called to deserialize POJO value from a JSON floating-point
number.
|
Object |
deserializeFromEmbedded(JsonParser p,
DeserializationContext ctxt) |
Object |
deserializeFromNumber(JsonParser p,
DeserializationContext ctxt) |
abstract Object |
deserializeFromObject(JsonParser p,
DeserializationContext ctxt)
General version used when handling needs more advanced
features.
|
protected Object |
deserializeFromObjectId(JsonParser p,
DeserializationContext ctxt)
Method called in cases where it looks like we got an Object Id
to parse and use as a reference.
|
protected Object |
deserializeFromObjectUsingNonDefault(JsonParser p,
DeserializationContext ctxt) |
Object |
deserializeFromString(JsonParser p,
DeserializationContext ctxt) |
protected Object |
deserializeWithObjectId(JsonParser p,
DeserializationContext ctxt)
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.
|
Object |
deserializeWithType(JsonParser p,
DeserializationContext ctxt,
TypeDeserializer typeDeserializer)
Base implementation that does not assume specific type
inclusion mechanism.
|
SettableBeanProperty |
findBackReference(String logicalName)
Method needed by
BeanDeserializerFactory to properly link
managed- and back-reference pairs. |
protected JsonDeserializer<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).
|
SettableBeanProperty |
findProperty(int propertyIndex)
Alternate find method that tries to locate a property with given
property index . |
SettableBeanProperty |
findProperty(PropertyName propertyName) |
SettableBeanProperty |
findProperty(String propertyName)
Accessor for finding the property with given name, if POJO
has one.
|
Class<?> |
getBeanClass()
Deprecated.
Since 2.3, use
handledType() instead |
AccessPattern |
getEmptyAccessPattern()
This method may be called in conjunction with calls to
JsonDeserializer.getEmptyValue(DeserializationContext) , to check whether it needs
to be called just once (static values), or each time empty value is
needed. |
Object |
getEmptyValue(DeserializationContext ctxt)
Method called to determine value to be used for "empty" values
(most commonly when deserializing from empty JSON Strings).
|
Collection<Object> |
getKnownPropertyNames()
Method that will
either return null to indicate that type being deserializers
has no concept of properties; or a collection of identifiers
for which
toString will give external property
name. |
AccessPattern |
getNullAccessPattern()
This method may be called in conjunction with calls to
JsonDeserializer.getNullValue(DeserializationContext) , to check whether it needs
to be called just once (static values), or each time empty value is
needed. |
ObjectIdReader |
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).
|
int |
getPropertyCount()
Accessor for checking number of deserialized properties.
|
ValueInstantiator |
getValueInstantiator() |
JavaType |
getValueType()
Exact structured type this deserializer handles, if known.
|
Class<?> |
handledType()
Method for accessing concrete physical type of values this deserializer produces.
|
protected void |
handleIgnoredProperty(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 Object |
handlePolymorphic(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 Object |
handleUnknownProperties(DeserializationContext ctxt,
Object bean,
TokenBuffer unknownTokens)
Method called to handle set of one or more unknown properties,
stored in their entirety in given
TokenBuffer
(as field entries, name and value). |
protected void |
handleUnknownProperty(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 void |
handleUnknownVanilla(JsonParser p,
DeserializationContext ctxt,
Object beanOrBuilder,
String propName)
Helper method called for an unknown property, when using "vanilla"
processing.
|
boolean |
hasProperty(String propertyName) |
boolean |
hasViews() |
protected void |
injectValues(DeserializationContext ctxt,
Object bean) |
boolean |
isCachable()
Method called to see if deserializer instance is cachable and
usable for other properties of same type (type for which instance
was created).
|
boolean |
isCaseInsensitive()
Accessor for checking whether this deserializer is operating
in case-insensitive manner.
|
LogicalType |
logicalType()
Method for accessing logical type of values this deserializer produces.
|
Iterator<SettableBeanProperty> |
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 calling
creatorProperties() |
void |
replaceProperty(SettableBeanProperty original,
SettableBeanProperty replacement)
Method that can be used to replace an existing property with
a modified one.
|
void |
resolve(DeserializationContext ctxt)
Method called to finalize setup of this deserializer,
after deserializer itself has been registered.
|
Boolean |
supportsUpdate(DeserializationConfig config)
Introspection method that may be called to see whether deserializer supports
update of an existing value (aka "merging") or not.
|
abstract JsonDeserializer<Object> |
unwrappingDeserializer(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.
|
BeanDeserializerBase |
withBeanProperties(BeanPropertyMap props)
Mutant factory method that custom sub-classes must override; not left as
abstract to prevent more drastic backwards compatibility problems.
|
abstract BeanDeserializerBase |
withByNameInclusion(Set<String> ignorableProps,
Set<String> includableProps) |
BeanDeserializerBase |
withIgnorableProperties(Set<String> ignorableProps)
Deprecated.
Since 2.12 use
withByNameInclusion(java.util.Set<java.lang.String>, java.util.Set<java.lang.String>) instead |
abstract BeanDeserializerBase |
withIgnoreAllUnknown(boolean ignoreUnknown) |
abstract BeanDeserializerBase |
withObjectIdReader(ObjectIdReader oir) |
void |
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 of
IOException , or an unchecked exception. |
protected Object |
wrapInstantiationProblem(Throwable t,
DeserializationContext ctxt) |
_byteOverflow, _checkCoercionFail, _checkDoubleSpecialValue, _checkFloatSpecialValue, _checkFloatToIntCoercion, _checkFromStringCoercion, _checkFromStringCoercion, _checkTextualNull, _coerceBooleanFromInt, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeFromEmptyString, _deserializeFromString, _deserializeWrappedValue, _failDoubleToIntCoercion, _findCoercionFromBlankString, _findCoercionFromEmptyArray, _findCoercionFromEmptyString, _findNullProvider, _hasTextualNull, _intOverflow, _isBlank, _isEmptyOrTextualNull, _isFalse, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _isTrue, _neitherNull, _nonNullNumber, _parseBoolean, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDouble, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseInteger, _parseIntPrimitive, _parseIntPrimitive, _parseLong, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueType, handleMissingEndArrayForSingle, isDefaultDeserializer, isDefaultKeyDeserializer
deserialize, deserialize, deserializeWithType, getDelegatee, getEmptyValue, getNullValue, getNullValue, replaceDelegatee
protected static final PropertyName TEMP_PROPERTY_NAME
protected final JavaType _beanType
protected final JsonFormat.Shape _serializationShape
protected final ValueInstantiator _valueInstantiator
protected JsonDeserializer<Object> _delegateDeserializer
protected JsonDeserializer<Object> _arrayDelegateDeserializer
protected PropertyBasedCreator _propertyBasedCreator
protected boolean _nonStandardCreation
Note that flag is somewhat mis-named as it is not affected by scalar-delegating creators; it only has effect on Object Value binding.
protected boolean _vanillaProcessing
protected final BeanPropertyMap _beanProperties
protected final ValueInjector[] _injectables
ValueInjector
s, 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.protected SettableAnyProperty _anySetter
protected final Set<String> _ignorableProps
protected final Set<String> _includableProps
protected final boolean _ignoreAllUnknown
protected final boolean _needViewProcesing
protected final Map<String,SettableBeanProperty> _backRefs
protected transient HashMap<ClassKey,JsonDeserializer<Object>> _subDeserializers
protected UnwrappedPropertyHandler _unwrappedPropertyHandler
protected ExternalTypeHandler _externalTypeIdHandler
protected final ObjectIdReader _objectIdReader
protected BeanDeserializerBase(BeanDeserializerBuilder builder, BeanDescription beanDesc, BeanPropertyMap properties, Map<String,SettableBeanProperty> backRefs, Set<String> ignorableProps, boolean ignoreAllUnknown, Set<String> includableProps, boolean hasViews)
BeanDeserializerBuilder
that
contains configuration.protected BeanDeserializerBase(BeanDeserializerBase src)
protected BeanDeserializerBase(BeanDeserializerBase src, boolean ignoreAllUnknown)
protected BeanDeserializerBase(BeanDeserializerBase src, NameTransformer unwrapper)
public BeanDeserializerBase(BeanDeserializerBase src, ObjectIdReader oir)
public BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps)
protected BeanDeserializerBase(BeanDeserializerBase src, BeanPropertyMap beanProps)
@Deprecated protected BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps)
public abstract JsonDeserializer<Object> unwrappingDeserializer(NameTransformer unwrapper)
JsonDeserializer
Default implementation just returns 'this' indicating that no unwrapped variant exists
unwrappingDeserializer
in class JsonDeserializer<Object>
public abstract BeanDeserializerBase withObjectIdReader(ObjectIdReader oir)
public abstract BeanDeserializerBase withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps)
public abstract BeanDeserializerBase withIgnoreAllUnknown(boolean ignoreUnknown)
public BeanDeserializerBase withBeanProperties(BeanPropertyMap props)
protected abstract BeanDeserializerBase asArrayDeserializer()
@Deprecated public BeanDeserializerBase withIgnorableProperties(Set<String> ignorableProps)
withByNameInclusion(java.util.Set<java.lang.String>, java.util.Set<java.lang.String>)
insteadpublic void resolve(DeserializationContext ctxt) throws JsonMappingException
resolve
in interface ResolvableDeserializer
ctxt
- Context to use for accessing configuration, resolving
secondary deserializersJsonMappingException
protected void _replaceProperty(BeanPropertyMap props, SettableBeanProperty[] creatorProps, SettableBeanProperty origProp, SettableBeanProperty newProp)
protected JsonDeserializer<Object> findConvertingDeserializer(DeserializationContext ctxt, SettableBeanProperty prop) throws JsonMappingException
NOTE: returned deserializer is NOT yet contextualized, caller needs to take care to do that.
JsonMappingException
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) throws JsonMappingException
createContextual
in interface ContextualDeserializer
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)JsonMappingException
protected BeanDeserializerBase _handleByNameInclusion(DeserializationContext ctxt, AnnotationIntrospector intr, BeanDeserializerBase contextual, AnnotatedMember accessor) throws JsonMappingException
JsonMappingException
protected SettableBeanProperty _resolveManagedReferenceProperty(DeserializationContext ctxt, SettableBeanProperty prop) throws JsonMappingException
JsonMappingException
protected SettableBeanProperty _resolvedObjectIdProperty(DeserializationContext ctxt, SettableBeanProperty prop) throws JsonMappingException
ObjectIdReferenceProperty
in case where object id resolution is required.JsonMappingException
protected NameTransformer _findPropertyUnwrapper(DeserializationContext ctxt, SettableBeanProperty prop) throws JsonMappingException
JsonMappingException
protected SettableBeanProperty _resolveInnerClassValuedProperty(DeserializationContext ctxt, SettableBeanProperty prop)
protected SettableBeanProperty _resolveMergeAndNullSettings(DeserializationContext ctxt, SettableBeanProperty prop, PropertyMetadata propMetadata) throws JsonMappingException
JsonMappingException
public AccessPattern getNullAccessPattern()
JsonDeserializer
JsonDeserializer.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 "null value" to use for input null is simply Java `null` for all deserializers, unless overridden by sub-classes. This information may be used as optimization.
getNullAccessPattern
in interface NullValueProvider
getNullAccessPattern
in class JsonDeserializer<Object>
public AccessPattern getEmptyAccessPattern()
JsonDeserializer
JsonDeserializer.getEmptyValue(DeserializationContext)
, to check whether it needs
to be called just once (static values), or each time empty value is
needed.getEmptyAccessPattern
in class JsonDeserializer<Object>
public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException
JsonDeserializer
JsonDeserializer.getNullValue(com.fasterxml.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
JsonDeserializer.getEmptyAccessPattern()
returns.
Default implementation simply calls JsonDeserializer.getNullValue(com.fasterxml.jackson.databind.DeserializationContext)
and
returns value.
getEmptyValue
in class JsonDeserializer<Object>
JsonMappingException
public boolean isCachable()
JsonDeserializer
Note that cached instances are still resolved on per-property basis,
if instance implements ResolvableDeserializer
:
cached instance is just as the base. 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.
isCachable
in class JsonDeserializer<Object>
public boolean isCaseInsensitive()
public Boolean supportsUpdate(DeserializationConfig config)
JsonDeserializer
Boolean.FALSE
if update is not supported at all (immutable values);
Boolean.TRUE
if update should usually work (regular POJOs, for example),
or null
if 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
deserialization construction if explicit attempt made) if Boolean.FALSE
returned, or inclusion if Boolean.TRUE
is specified. If "unknown" case
(null
returned) behavior is to exclude property if global defaults
used; or to allow if explicit per-type or property merging is defined.
Default implementation returns null
to allow explicit per-type
or per-property attempts.
supportsUpdate
in class JsonDeserializer<Object>
public Class<?> handledType()
JsonDeserializer
Default implementation will return null, which means almost same
same as returning Object.class
would; that is, that
nothing is known about handled type.
handledType
in class StdDeserializer<Object>
null
if notpublic ObjectIdReader getObjectIdReader()
getObjectIdReader
in class JsonDeserializer<Object>
public boolean hasProperty(String propertyName)
public boolean hasViews()
public int getPropertyCount()
public Collection<Object> getKnownPropertyNames()
JsonDeserializer
toString
will give external property
name.
This is only to be used for error reporting and diagnostics
purposes (most commonly, to accompany "unknown property"
exception).getKnownPropertyNames
in class JsonDeserializer<Object>
@Deprecated public final Class<?> getBeanClass()
handledType()
insteadpublic JavaType getValueType()
StdDeserializer
getValueType
in class StdDeserializer<Object>
public LogicalType logicalType()
JsonDeserializer
logicalType
in class JsonDeserializer<Object>
null
if notpublic Iterator<SettableBeanProperty> properties()
creatorProperties()
public Iterator<SettableBeanProperty> creatorProperties()
public SettableBeanProperty findProperty(PropertyName propertyName)
public SettableBeanProperty findProperty(String propertyName)
public SettableBeanProperty findProperty(int propertyIndex)
property 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.public SettableBeanProperty findBackReference(String logicalName)
BeanDeserializerFactory
to properly link
managed- and back-reference pairs.findBackReference
in class JsonDeserializer<Object>
public ValueInstantiator getValueInstantiator()
getValueInstantiator
in interface ValueInstantiator.Gettable
getValueInstantiator
in class StdDeserializer<Object>
public void replaceProperty(SettableBeanProperty original, SettableBeanProperty replacement)
NOTE: only ever use this method if you know what you are doing; incorrect usage can break deserializer.
original
- Property to replacereplacement
- Property to replace it withpublic abstract Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException
StdDeserializer
deserializeWithType
in class StdDeserializer<Object>
typeDeserializer
- Deserializer to use for handling type informationIOException
protected Object _handleTypedObjectId(JsonParser p, DeserializationContext ctxt, Object pojo, Object rawId) throws IOException
IOException
protected Object _convertObjectId(JsonParser p, DeserializationContext ctxt, Object rawId, JsonDeserializer<Object> idDeser) throws IOException
IOException
protected Object deserializeWithObjectId(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected Object deserializeFromObjectId(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected Object deserializeFromObjectUsingNonDefault(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected abstract Object _deserializeUsingPropertyBased(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeFromNumber(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeFromString(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeFromDouble(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeFromBoolean(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
@Deprecated public Object deserializeFromArray(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
public Object deserializeFromEmbedded(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final JsonDeserializer<Object> _delegateDeserializer()
protected void injectValues(DeserializationContext ctxt, Object bean) throws IOException
IOException
protected Object handleUnknownProperties(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws IOException
TokenBuffer
(as field entries, name and value).IOException
protected void handleUnknownVanilla(JsonParser p, DeserializationContext ctxt, Object beanOrBuilder, String propName) throws IOException
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.IOException
protected void handleUnknownProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) throws IOException
handleUnknownProperty
in class StdDeserializer<Object>
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 what StdDeserializer.getValueClass()
returns.propName
- Name of the property that cannot be mappedIOException
protected void handleIgnoredProperty(JsonParser p, DeserializationContext ctxt, Object beanOrClass, String propName) throws IOException
IOException
protected Object handlePolymorphic(JsonParser p, DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws IOException
p
- (optional) If not null, parser that has more properties to handle
(in addition to buffered properties); if null, all properties are passed
in bufferIOException
protected JsonDeserializer<Object> _findSubclassDeserializer(DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens) throws IOException
IOException
public void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt) throws IOException
IOException
, or an unchecked exception.
Rules for wrapping and unwrapping are bit complicated; essentially:
JsonMappingException
are to be passed as is
IOException
protected Object wrapInstantiationProblem(Throwable t, DeserializationContext ctxt) throws IOException
IOException
Copyright © 2021 JBoss by Red Hat. All rights reserved.