Top Fields Constructors Methods
com.fasterxml.jackson.databind.deser.impl

public Class BeanAsArrayBuilderDeserializer

extends BeanDeserializerBase
Class Inheritance
Imports
java.io.IOException, java.util.Set, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.*, com.fasterxml.jackson.databind.introspect.AnnotatedMethod, com.fasterxml.jackson.databind.util.ClassUtil, .NameTransformer

Field Summary

Modifier and TypeField and Description
protected final AnnotatedMethod
protected final BeanDeserializerBase
_delegate

Deserializer we delegate operations that we cannot handle.

protected final SettableBeanProperty[]
_orderedProperties

Properties in order expected to be found in JSON array.

protected final JavaType
_targetType

Type that the builder will produce, target type; as opposed to `handledType()` which refers to Builder class.

private static final long
Inherited from com.fasterxml.jackson.databind.deser.BeanDeserializerBase:
_anySetter_arrayDelegateDeserializer_backRefs_beanProperties_beanType_delegateDeserializer_externalTypeIdHandler_ignorableProps_ignoreAllUnknown_includableProps_injectables_needViewProcesing_nonStandardCreation_objectIdReader_propertyBasedCreator_serializationShape_subDeserializers_unwrappedPropertyHandler_valueInstantiator_vanillaProcessingTEMP_PROPERTY_NAME

Constructor Summary

AccessConstructor and Description
public
BeanAsArrayBuilderDeserializer(BeanDeserializerBase delegate, JavaType targetType, SettableBeanProperty[] ordered, AnnotatedMethod buildMethod)

Main constructor used both for creating new instances (by BeanDeserializer#asArrayDeserializer) and for creating copies with different delegate.

Method Summary

Modifier and TypeMethod and Description
protected Object
protected Object

Returns:

Builder object in use.
_deserializeNonVanilla
(JsonParser p, DeserializationContext ctxt)

Alternate deserialization method that has to check many more configuration aspects than the "vanilla" processing.

protected final Object
_deserializeUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase._deserializeUsingPropertyBased.

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.
protected BeanDeserializerBase
asArrayDeserializer()

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.asArrayDeserializer.

Fluent factory for creating a variant that can handle POJO output as a JSON Array.
public Object
deserialize(JsonParser
Parsed used for reading JSON content
p
,
DeserializationContext
Context that can be used to access information about this deserialization activity.
ctxt
)

Implements abstract com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles.
public Object
deserialize(JsonParser p, DeserializationContext ctxt, Object value)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Alternate deserialization method (compared to the most commonly used, deserialize(JsonParser, DeserializationContext)), which takes in initialized value instance, to be configured and/or populated by deserializer.
public Object
deserializeFromObject(JsonParser p, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObject.

General version used when handling needs more advanced features.
protected final Object
public Boolean
supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.supportsUpdate.

Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not.
public JsonDeserializer<Object>
unwrappingDeserializer(NameTransformer unwrapper)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.unwrappingDeserializer.

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)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.
public BeanDeserializerBase
public BeanDeserializerBase
public BeanDeserializerBase
Inherited from com.fasterxml.jackson.databind.deser.BeanDeserializerBase:
_convertObjectId_delegateDeserializer_findPropertyUnwrapper_findSubclassDeserializer_handleByNameInclusion_handleTypedObjectId_replaceProperty_resolvedObjectIdProperty_resolveInnerClassValuedProperty_resolveManagedReferenceProperty_resolveMergeAndNullSettingscreateContextualcreatorPropertiesdeserializeFromArraydeserializeFromBooleandeserializeFromDoubledeserializeFromEmbeddeddeserializeFromNumberdeserializeFromObjectIddeserializeFromObjectUsingNonDefaultdeserializeFromStringdeserializeWithObjectIddeserializeWithTypefindBackReferencefindConvertingDeserializerfindPropertyfindPropertyfindPropertygetBeanClassgetEmptyAccessPatterngetEmptyValuegetKnownPropertyNamesgetNullAccessPatterngetObjectIdReadergetPropertyCountgetValueInstantiatorgetValueTypehandledTypehandleIgnoredPropertyhandlePolymorphichandlePolymorphichandleUnknownPropertieshandleUnknownPropertyhandleUnknownVanillahasPropertyhasViewsinjectValuesisCachableisCaseInsensitivelogicalTypepropertiesreplacePropertyresolvewithIgnorablePropertieswrapAndThrowwrapInstantiationProblem

Field Detail

_buildMethodback to summary
protected final AnnotatedMethod _buildMethod
_delegateback to summary
protected final BeanDeserializerBase _delegate

Deserializer we delegate operations that we cannot handle.

_orderedPropertiesback to summary
protected final SettableBeanProperty[] _orderedProperties

Properties in order expected to be found in JSON array.

_targetTypeback to summary
protected final JavaType _targetType

Type that the builder will produce, target type; as opposed to `handledType()` which refers to Builder class.

Since
2.9
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.serialVersionUID.

Constructor Detail

BeanAsArrayBuilderDeserializerback to summary
public BeanAsArrayBuilderDeserializer(BeanDeserializerBase delegate, JavaType targetType, SettableBeanProperty[] ordered, AnnotatedMethod buildMethod)

Main constructor used both for creating new instances (by BeanDeserializer#asArrayDeserializer) and for creating copies with different delegate.

Since
2.9

Method Detail

_deserializeFromNonArrayback to summary
protected Object _deserializeFromNonArray(JsonParser p, DeserializationContext ctxt) throws IOException
_deserializeNonVanillaback to summary
protected Object _deserializeNonVanilla(JsonParser p, DeserializationContext ctxt) throws IOException

Alternate deserialization method that has to check many more configuration aspects than the "vanilla" processing.

Note

should NOT resolve builder; caller will do that

Returns:Object

Builder object in use.

_deserializeUsingPropertyBasedback to summary
protected final Object _deserializeUsingPropertyBased(final JsonParser p, final DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase._deserializeUsingPropertyBased.

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.

Annotations
@Override
asArrayDeserializerback to summary
protected BeanDeserializerBase asArrayDeserializer()

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.asArrayDeserializer.

Doc from com.fasterxml.jackson.databind.deser.BeanDeserializerBase.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.

Annotations
@Override
deserializeback to summary
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. Returned instance is to be constructed by method itself.

Pre-condition for this method is that the parser points to the first event that is part of value to deserializer (and which is never JSON 'null' literal, more on this below): for simple types it may be the only value; and for structured types the Object start marker or a FIELD_NAME.

The two possible input conditions for structured types result from polymorphism via fields. In the ordinary case, Jackson calls this method when it has encountered an OBJECT_START, and the method implementation must advance to the next token to see the first field name. If the application configures polymorphism via a field, then the object looks like the following.

      {
          "@class": "class name",
          ...
      }
  
Jackson consumes the two tokens (the @class field name and its value) in order to learn the class and select the deserializer. Thus, the stream is pointing to the FIELD_NAME for the first field after the @class. Thus, if you want your method to work correctly both with and without polymorphism, you must begin your method with:
       if (p.currentToken() == JsonToken.START_OBJECT) {
         p.nextToken();
       }
  
This results in the stream pointing to the field name, so that the two conditions align.

Post-condition is that the parser will point to the last event that is part of deserialized value (or in case deserialization fails, event that was not recognized or usable, which may be the same event as the one it pointed to upon call).

Note that this method is never called for JSON null literal, and thus deserializers need (and should) not check for it.

Parameters
p:JsonParser

Parsed used for reading JSON content

ctxt:DeserializationContext

Context that can be used to access information about this deserialization activity.

Returns:Object

Deserialized value

Annotations
@Override
deserializeback to summary
public Object deserialize(JsonParser p, DeserializationContext ctxt, Object value) throws IOException

Overrides com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

Alternate deserialization method (compared to the most commonly used, deserialize(JsonParser, DeserializationContext)), which takes in initialized value instance, to be configured and/or populated by deserializer. Method is not necessarily used (or supported) by all types (it will not work for immutable types, for obvious reasons): most commonly it is used for Collections and Maps. It may be used both with "updating readers" (for POJOs) and when Collections and Maps use "getter as setter".

Default implementation just throws UnsupportedOperationException, to indicate that types that do not explicitly add support do not necessarily support update-existing-value operation (esp. immutable types)

Annotations
@Override
deserializeFromObjectback to summary
public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObject.

Doc from com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObject.

General version used when handling needs more advanced features.

Annotations
@Override
finishBuildback to summary
protected final Object finishBuild(DeserializationContext ctxt, Object builder) throws IOException
supportsUpdateback to summary
public Boolean supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.supportsUpdate.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.supportsUpdate.

Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. Return value should either be 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 deserializer 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.

Annotations
@Override
unwrappingDeserializerback to summary
public JsonDeserializer<Object> unwrappingDeserializer(NameTransformer unwrapper)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.unwrappingDeserializer.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.unwrappingDeserializer.

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.

Default implementation just returns 'this' indicating that no unwrapped variant exists

Annotations
@Override
withBeanPropertiesback to summary
public BeanDeserializerBase withBeanProperties(BeanPropertyMap props)

Overrides com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Doc from com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withBeanProperties.

Mutant factory method that custom sub-classes must override; not left as abstract to prevent more drastic backwards compatibility problems.

Annotations
@Override
withByNameInclusionback to summary
public BeanDeserializerBase withByNameInclusion(Set<String> ignorableProps, Set<String> includableProps)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withByNameInclusion.

Annotations
@Override
withIgnoreAllUnknownback to summary
public BeanDeserializerBase withIgnoreAllUnknown(boolean ignoreUnknown)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withIgnoreAllUnknown.

Annotations
@Override
withObjectIdReaderback to summary
public BeanDeserializerBase withObjectIdReader(ObjectIdReader oir)

Implements abstract com.fasterxml.jackson.databind.deser.BeanDeserializerBase.withObjectIdReader.

Annotations
@Override