Top Inners Fields Constructors Methods
com.fasterxml.jackson.databind.deser.std

pack-priv final Class UntypedObjectDeserializerNR

extends StdDeserializer<Object>
Class Inheritance
Annotations
@JacksonStdImpl
Imports
java.io.IOException, java.util.ArrayList, .Collection, .LinkedHashMap, .List, .Map, .Objects, com.fasterxml.jackson.core.JsonParser, .JsonToken, .JsonTokenId, .StreamReadCapability, com.fasterxml.jackson.databind.DeserializationConfig, .DeserializationContext, .DeserializationFeature, com.fasterxml.jackson.databind.annotation.JacksonStdImpl, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.type.LogicalType

Since
2.14

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
UntypedObjectDeserializerNR.Scope

Helper class used for building Maps and Lists/Arrays.

Field Summary

Modifier and TypeField and Description
protected final boolean
protected static final Object[]
private static final long
public static final UntypedObjectDeserializerNR
Inherited from com.fasterxml.jackson.databind.deser.std.StdDeserializer:
_valueClass_valueTypeF_MASK_ACCEPT_ARRAYSF_MASK_INT_COERCIONS

Constructor Summary

AccessConstructor and Description
public
protected
UntypedObjectDeserializerNR(boolean nonMerging)

Method Summary

Modifier and TypeMethod and Description
private Object
protected Object
private Object
private Object
protected Object
_mapObjectWithDups(JsonParser p, DeserializationContext ctxt, final Map<String, Object> result, String initialKey, Object oldValue, Object newValue, String nextKey)

private void
_squashDups(final Map<String, Object> result, String key, Object oldValue, Object newValue)

public Object
deserialize(JsonParser
Parser 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 intoValue)

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
deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer
Deserializer to use for handling type information
typeDeserializer
)

Overrides com.fasterxml.jackson.databind.deser.std.StdDeserializer.deserializeWithType.

Base implementation that does not assume specific type inclusion mechanism.

public static UntypedObjectDeserializerNR
instance(boolean nonMerging)

public LogicalType
logicalType()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.logicalType.

Method for accessing logical type of values this deserializer produces.

public Boolean
supportsUpdate(DeserializationConfig config)

Overrides 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.

Inherited from com.fasterxml.jackson.databind.deser.std.StdDeserializer:
_byteOverflow_checkBooleanToStringCoercion_checkCoercionFail_checkDoubleSpecialValue_checkFloatSpecialValue_checkFloatToIntCoercion_checkFloatToStringCoercion_checkFromStringCoercion_checkFromStringCoercion_checkIntToFloatCoercion_checkIntToStringCoercion_checkTextualNull_checkToStringCoercion_coerceBooleanFromInt_coercedTypeDesc_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_parseDouble_parseDoublePrimitive_parseDoublePrimitive_parseDoublePrimitive_parseFloatPrimitive_parseFloatPrimitive_parseFloatPrimitive_parseInteger_parseInteger_parseIntPrimitive_parseIntPrimitive_parseLong_parseLong_parseLongPrimitive_parseLongPrimitive_parseShortPrimitive_parseString_parseString_reportFailedNullCoerce_shortOverflow_verifyEndArrayForSingle_verifyNullForPrimitive_verifyNullForPrimitiveCoercion_verifyNullForScalarCoercion_verifyNumberForScalarCoercion_verifyStringForScalarCoercionfindContentNullProviderfindContentNullStylefindConvertingContentDeserializerfindDeserializerfindFormatFeaturefindFormatOverridesfindValueNullProvidergetValueClassgetValueInstantiatorgetValueTypegetValueTypehandledTypehandleMissingEndArrayForSinglehandleNestedArrayForSinglehandleUnknownPropertyisDefaultDeserializerisDefaultKeyDeserializer

Field Detail

_nonMergingback to summary
protected final boolean _nonMerging
NO_OBJECTSback to summary
protected static final Object[] NO_OBJECTS
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.deser.std.StdDeserializer.serialVersionUID.

stdback to summary
public static final UntypedObjectDeserializerNR std

Constructor Detail

UntypedObjectDeserializerNRback to summary
public UntypedObjectDeserializerNR()
UntypedObjectDeserializerNRback to summary
protected UntypedObjectDeserializerNR(boolean nonMerging)

Method Detail

_deserializeAnyScalarback to summary
private Object _deserializeAnyScalar(JsonParser p, DeserializationContext ctxt, int tokenType) throws IOException
_deserializeFPback to summary
protected Object _deserializeFP(JsonParser p, DeserializationContext ctxt) throws IOException
_deserializeNRback to summary
private Object _deserializeNR(JsonParser p, DeserializationContext ctxt, UntypedObjectDeserializerNR.Scope rootScope) throws IOException
_deserializeObjectAtNameback to summary
private Object _deserializeObjectAtName(JsonParser p, DeserializationContext ctxt) throws IOException
_mapObjectWithDupsback to summary
protected Object _mapObjectWithDups(JsonParser p, DeserializationContext ctxt, final Map<String, Object> result, String initialKey, Object oldValue, Object newValue, String nextKey) throws IOException
_squashDupsback to summary
private void _squashDups(final Map<String, Object> result, String key, Object oldValue, Object newValue)
Annotations
@SuppressWarnings:unchecked
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).

Handling null values (JsonToken.VALUE_NULL)
: Note that this method is never called for the JSON null literal to avoid every deserializer from having to handle null values. Instead, the JsonDeserializer#getNullValue(DeserializationContext) method is called to produce a null value. To influence null handling, custom deserializers should override JsonDeserializer#getNullValue(DeserializationContext) and usually also JsonDeserializer#getNullAccessPattern().

Parameters
p:JsonParser

Parser 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 intoValue) 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
@SuppressWarnings:unchecked
@Override
deserializeWithTypeback to summary
public Object deserializeWithType(JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException

Overrides com.fasterxml.jackson.databind.deser.std.StdDeserializer.deserializeWithType.

Doc from com.fasterxml.jackson.databind.deser.std.StdDeserializer.deserializeWithType.

Base implementation that does not assume specific type inclusion mechanism. Sub-classes are expected to override this method if they are to handle type information.

Parameters
typeDeserializer:TypeDeserializer

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

Deserializer to use for handling type information

Annotations
@Override
instanceback to summary
public static UntypedObjectDeserializerNR instance(boolean nonMerging)
logicalTypeback to summary
public LogicalType logicalType()

Overrides com.fasterxml.jackson.databind.JsonDeserializer.logicalType.

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

Method 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.

Returns:LogicalType

Logical type of values this deserializer produces, if known; null if not

Annotations
@Override
supportsUpdateback to summary
public Boolean supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.JsonDeserializer.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
com.fasterxml.jackson.databind.deser.std back to summary

private final Class UntypedObjectDeserializerNR.Scope

extends Object
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializerNR.Scope

Helper class used for building Maps and Lists/Arrays.

Field Summary

Modifier and TypeField and Description
private UntypedObjectDeserializerNR.Scope
private String
private boolean
private List<Object>
private Map<String, Object>
private final UntypedObjectDeserializerNR.Scope
private boolean

Constructor Summary

AccessConstructor and Description
private
private
Scope(UntypedObjectDeserializerNR.Scope p, boolean isObject, boolean squashDups)

Method Summary

Modifier and TypeMethod and Description
private void
public void
public UntypedObjectDeserializerNR.Scope
public UntypedObjectDeserializerNR.Scope
childArray(String deferredKey)

public UntypedObjectDeserializerNR.Scope
public UntypedObjectDeserializerNR.Scope
childObject(String deferredKey)

public static List<Object>
public static Map<String, Object>
public UntypedObjectDeserializerNR.Scope
finishBranchArray(boolean asJavaArray)

public UntypedObjectDeserializerNR.Scope
public Object
finishRootArray(boolean asJavaArray)

public Object
public boolean
public UntypedObjectDeserializerNR.Scope
public void
putValue(String key, Object value)

private UntypedObjectDeserializerNR.Scope
private UntypedObjectDeserializerNR.Scope
resetAsObject(boolean squashDups)

public static UntypedObjectDeserializerNR.Scope
public static UntypedObjectDeserializerNR.Scope
rootObjectScope(boolean squashDups)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_childback to summary
private UntypedObjectDeserializerNR.Scope _child
_deferredKeyback to summary
private String _deferredKey
_isObjectback to summary
private boolean _isObject
_listback to summary
private List<Object> _list
_mapback to summary
private Map<String, Object> _map
_parentback to summary
private final UntypedObjectDeserializerNR.Scope _parent
_squashDupsback to summary
private boolean _squashDups

Constructor Detail

Scopeback to summary
private Scope(UntypedObjectDeserializerNR.Scope p)
Scopeback to summary
private Scope(UntypedObjectDeserializerNR.Scope p, boolean isObject, boolean squashDups)

Method Detail

_putValueHandleDupsback to summary
private void _putValueHandleDups(String key, Object newValue)
Annotations
@SuppressWarnings:unchecked
addValueback to summary
public void addValue(Object value)
childArrayback to summary
public UntypedObjectDeserializerNR.Scope childArray()
childArrayback to summary
public UntypedObjectDeserializerNR.Scope childArray(String deferredKey)
childObjectback to summary
public UntypedObjectDeserializerNR.Scope childObject()
childObjectback to summary
public UntypedObjectDeserializerNR.Scope childObject(String deferredKey)
emptyListback to summary
public static List<Object> emptyList()
emptyMapback to summary
public static Map<String, Object> emptyMap()
finishBranchArrayback to summary
public UntypedObjectDeserializerNR.Scope finishBranchArray(boolean asJavaArray)
finishBranchObjectback to summary
public UntypedObjectDeserializerNR.Scope finishBranchObject()
finishRootArrayback to summary
public Object finishRootArray(boolean asJavaArray)
finishRootObjectback to summary
public Object finishRootObject()
isObjectback to summary
public boolean isObject()
putDeferredValueback to summary
public UntypedObjectDeserializerNR.Scope putDeferredValue(Object value)
putValueback to summary
public void putValue(String key, Object value)
resetAsArrayback to summary
private UntypedObjectDeserializerNR.Scope resetAsArray()
resetAsObjectback to summary
private UntypedObjectDeserializerNR.Scope resetAsObject(boolean squashDups)
rootArrayScopeback to summary
public static UntypedObjectDeserializerNR.Scope rootArrayScope()
rootObjectScopeback to summary
public static UntypedObjectDeserializerNR.Scope rootObjectScope(boolean squashDups)