BeanDeserializer
.
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 | _arrayDelegateDeserializer
Deserializer that is used iff array-delegate-based creator is to be used for deserializing from JSON Object. |
protected final Map | _backRefs
We may also have one or more back reference fields (usually zero or one). |
protected final BeanPropertyMap | _beanProperties
Mapping of property names to properties, built when all properties to use have been successfully resolved. |
protected final JavaType | _beanType
Declared type of the bean this deserializer handles. |
protected JsonDeserializer | _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 if any of properties uses external type id. |
protected final Set | _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 final boolean | _ignoreAllUnknown
Flag that can be set to ignore and skip unknown properties. |
protected final Set | _includableProps
Keep track of the the properties that needs to be specifically included. |
protected final ValueInjector[] | _injectables
List of |
protected final 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 final 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 final JsonFormat. | _serializationShape
Requested shape from bean class annotations. |
protected transient ConcurrentHashMap | _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 final 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. |
private static final long | |
protected static final PropertyName |
Access | Constructor and Description |
---|---|
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 |
protected | |
protected | |
protected | |
public | |
public | BeanDeserializerBase(BeanDeserializerBase src, Set<String> ignorableProps, Set<String> includableProps)
|
protected | |
protected |
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 final JsonDeserializer | |
protected final JsonDeserializer | _delegateDeserializer(JsonParser p)
Alternate to |
protected abstract Object | |
private JsonDeserializer | _findDelegateDeserializer(DeserializationContext ctxt, JavaType delegateType, AnnotatedWithParams delegateCreator)
|
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 | _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 from |
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 |
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. |
public JsonDeserializer | createContextual(DeserializationContext
Deserialization context to access configuration, additional
deserializers that may be needed by this deserializer ctxt, BeanProperty 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) property)Implements com. 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. |
public Iterator | creatorProperties()
Accessor for finding properties that represents values to pass through property-based creator method (constructor or factory method) |
public 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
|
public Object | deserializeFromBoolean(JsonParser p, DeserializationContext ctxt)
Method called to deserialize POJO value from a JSON boolean value (true, false) |
public Object | deserializeFromDouble(JsonParser p, DeserializationContext ctxt)
Method called to deserialize POJO value from a JSON floating-point number. |
public Object | |
public Object | |
public 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 | |
public Object | |
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. |
public Object | deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer
Deserializer to use for handling type information typeDeserializer)Overrides com. Base implementation that does not assume specific type inclusion mechanism. |
public SettableBeanProperty | findBackReference(String logicalName)
Overrides com. Method needed by |
protected JsonDeserializer | 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). |
public SettableBeanProperty | |
public SettableBeanProperty | findProperty(String propertyName)
Accessor for finding the property with given name, if POJO has one. |
public SettableBeanProperty | findProperty(int propertyIndex)
Alternate find method that tries to locate a property with given
|
public final Class | |
public AccessPattern | getEmptyAccessPattern()
Overrides com. This method may be called in conjunction with calls to
|
public Object | getEmptyValue(DeserializationContext ctxt)
Overrides com. Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings). |
public Collection | getKnownPropertyNames()
Overrides com. Method that will
either return null to indicate that type being deserializers
has no concept of properties; or a collection of identifiers
for which |
public AccessPattern | getNullAccessPattern()
Overrides com. Implements com. This method may be called in conjunction with calls to
|
public ObjectIdReader | getObjectIdReader()
Overrides com. 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). |
public int | |
public ValueInstantiator | |
public JavaType | getValueType()
Overrides com. Exact structured type this deserializer handles, if known. |
public Class | handledType()
Overrides com. 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
(optional) If not null, parser that has more properties to handle
(in addition to buffered properties); if null, all properties are passed
in buffer p, DeserializationContext ctxt, Object bean, TokenBuffer unknownTokens)
Deprecated
use
handlePolymorphic(JsonParser, DeserializationContext, StreamReadConstraints, Object, TokenBuffer)
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 | handlePolymorphic(JsonParser
(optional) If not null, parser that has more properties to handle
(in addition to buffered properties); if null, all properties are passed
in buffer p, DeserializationContext ctxt, StreamReadConstraints streamReadConstraints, 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 |
protected void | handleUnknownProperty(JsonParser
Parser that points to value of the unknown property p, DeserializationContext Context for deserialization; allows access to the parser,
error reporting functionality ctxt, Object Instance that is being populated by this
deserializer, or if not known, Class that would be instantiated.
If null, will assume type is what beanOrClass, String getValueClass returns.Name of the property that cannot be mapped propName)Overrides com. 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
Either POJO instance (if constructed), or builder
(in case of builder-based approach), that has property we haven't been
able to handle yet. beanOrBuilder, String propName)Helper method called for an unknown property, when using "vanilla" processing. |
public boolean | |
public boolean | |
protected void | |
public boolean | isCachable()
Overrides com. Method called to see if deserializer instance is cachable and usable for other properties of same type (type for which instance was created). |
public boolean | Returns: True if this deserializer should match property names without considering casing; false if case has to match exactly.Accessor for checking whether this deserializer is operating in case-insensitive manner. |
public LogicalType | logicalType()
Overrides com. Method for accessing logical type of values this deserializer produces. |
public Iterator | 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
|
public void | replaceProperty(SettableBeanProperty
Property to replace original, SettableBeanProperty Property to replace it with replacement)Method that can be used to replace an existing property with a modified one. |
public void | resolve(DeserializationContext
Context to use for accessing configuration, resolving
secondary deserializers ctxt)Implements com. Method called to finalize setup of this deserializer, after deserializer itself has been registered. |
public Boolean | supportsUpdate(DeserializationConfig config)
Overrides com. Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. |
private Throwable | |
public abstract JsonDeserializer | unwrappingDeserializer(NameTransformer unwrapper)
Overrides com. 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. |
public BeanDeserializerBase | withBeanProperties(BeanPropertyMap props)
Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems. |
public abstract BeanDeserializerBase | |
public BeanDeserializerBase | withIgnorableProperties(Set<String> ignorableProps)
Deprecated
Since 2.12 use
withByNameInclusion instead
|
public abstract BeanDeserializerBase | |
public abstract BeanDeserializerBase | |
public <T> T | 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 |
protected <T> T |