com.fasterxml.jackson.databind.deser

## Class DefaultDeserializationContext

- java.lang.Object
- - com.fasterxml.jackson.databind.DatabindContext
  - - com.fasterxml.jackson.databind.DeserializationContext
    - - com.fasterxml.jackson.databind.deser.DefaultDeserializationContext

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    DefaultDeserializationContext.Impl

      public abstract class DefaultDeserializationContext
      extends DeserializationContext
      implements java.io.Serializable

  Complete `DeserializationContext` implementation that adds extended API for `ObjectMapper` (and `ObjectReader`) to call, as well as implements certain parts that base class has left abstract. The remaining abstract methods (`createInstance(com.fasterxml.jackson.databind.DeserializationConfig, com.fasterxml.jackson.core.JsonParser, com.fasterxml.jackson.databind.InjectableValues)`, `with(com.fasterxml.jackson.databind.deser.DeserializerFactory)`) are left so that custom implementations will properly implement them to return intended subtype.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DefaultDeserializationContext.Impl` Actual full concrete implementation

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.LinkedHashMap<com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey,ReadableObjectId>` | `_objectIds`

    - ### Fields inherited from class com.fasterxml.jackson.databind.DeserializationContext

      `_arrayBuilders, _attributes, _cache, _config, _currentType, _dateFormat, _factory, _featureFlags, _injectableValues, _objectBuffer, _parser, _view`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DefaultDeserializationContext(DefaultDeserializationContext src)`
    `protected` | `DefaultDeserializationContext(DefaultDeserializationContext src, DeserializationConfig config, com.fasterxml.jackson.core.JsonParser jp, InjectableValues values)`
    `protected` | `DefaultDeserializationContext(DefaultDeserializationContext src, DeserializerFactory factory)`
    `protected` | `DefaultDeserializationContext(DeserializerFactory df, DeserializerCache cache)` Constructor that will pass specified deserializer factory and cache: cache may be null (in which case default implementation will be used), factory can not be null

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkUnresolvedObjectId()` Method called to ensure that every object id encounter during processing are resolved.
    `DefaultDeserializationContext` | `copy()` Method needed to ensure that `ObjectMapper.copy()` will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.
    `abstract DefaultDeserializationContext` | `createInstance(DeserializationConfig config, com.fasterxml.jackson.core.JsonParser jp, InjectableValues values)` Method called to create actual usable per-deserialization context instance.
    `protected ReadableObjectId` | `createReadableObjectId(com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey key)` Overridable factory method to create a new instance of ReadableObjectId or its subclass.
    `JsonDeserializer<java.lang.Object>` | `deserializerInstance(Annotated ann, java.lang.Object deserDef)`
    `ReadableObjectId` | `findObjectId(java.lang.Object id, com.fasterxml.jackson.annotation.ObjectIdGenerator<?> gen, com.fasterxml.jackson.annotation.ObjectIdResolver resolverType)` Method called to find and return entry corresponding to given Object Id: will add an entry if necessary, and never returns null
    `KeyDeserializer` | `keyDeserializerInstance(Annotated ann, java.lang.Object deserDef)`
    `protected boolean` | `tryToResolveUnresolvedObjectId(ReadableObjectId roid)` Overridable helper method called to try to resolve otherwise unresolvable `ReadableObjectId`; and if this succeeds, return `true` to indicate problem has been resolved in some way, so that caller can avoid reporting it as an error.
    `abstract DefaultDeserializationContext` | `with(DeserializerFactory factory)` Fluent factory method used for constructing a blueprint instance with different factory

    - ### Methods inherited from class com.fasterxml.jackson.databind.DeserializationContext

      `_calcName, _desc, _quotedString, _valueDesc, canOverrideAccessModifiers, constructCalendar, constructType, determineClassName, endOfInputException, findClass, findContextualValueDeserializer, findInjectableValue, findKeyDeserializer, findNonContextualValueDeserializer, findRootValueDeserializer, getActiveView, getAnnotationIntrospector, getArrayBuilders, getAttribute, getBase64Variant, getConfig, getContextualType, getDateFormat, getDefaultPropertyFormat, getDeserializationFeatures, getFactory, getLocale, getNodeFactory, getParser, getTimeZone, getTypeFactory, handleInstantiationProblem, handleMissingInstantiator, handlePrimaryContextualization, handlePrimaryContextualization, handleSecondaryContextualization, handleSecondaryContextualization, handleUnexpectedToken, handleUnexpectedToken, handleUnknownProperty, handleUnknownTypeId, handleWeirdKey, handleWeirdNumberValue, handleWeirdStringValue, hasDeserializationFeatures, hasSomeOfFeatures, hasValueDeserializerFor, instantiationException, instantiationException, isEnabled, isEnabled, leaseObjectBuffer, mappingException, mappingException, mappingException, mappingException, parseDate, readPropertyValue, readPropertyValue, readValue, readValue, reportBadPropertyDefinition, reportBadTypeDefinition, reportMappingException, reportMissingContent, reportUnknownProperty, reportUnresolvedObjectId, reportWrongTokenException, returnObjectBuffer, setAttribute, unknownTypeException, unknownTypeIdException, weirdKeyException, weirdNumberException, weirdStringException, wrongTokenException`

    - ### Methods inherited from class com.fasterxml.jackson.databind.DatabindContext

      `constructSpecializedType, constructType, converterInstance, objectIdGeneratorInstance, objectIdResolverInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _objectIds

          protected transient java.util.LinkedHashMap<com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey,ReadableObjectId> _objectIds

  - ### Constructor Detail

    - #### DefaultDeserializationContext

          protected DefaultDeserializationContext(DeserializerFactory df,
                                       DeserializerCache cache)

      Constructor that will pass specified deserializer factory and cache: cache may be null (in which case default implementation will be used), factory can not be null

    - #### DefaultDeserializationContext

          protected DefaultDeserializationContext(DefaultDeserializationContext src,
                                       DeserializationConfig config,
                                       com.fasterxml.jackson.core.JsonParser jp,
                                       InjectableValues values)

    - #### DefaultDeserializationContext

          protected DefaultDeserializationContext(DefaultDeserializationContext src,
                                       DeserializerFactory factory)

    - #### DefaultDeserializationContext

          protected DefaultDeserializationContext(DefaultDeserializationContext src)

      Since:
        2.4.4

  - ### Method Detail

    - #### copy

          public DefaultDeserializationContext copy()

      Method needed to ensure that `ObjectMapper.copy()` will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.
      Since:
        2.4.4

    - #### findObjectId

          public ReadableObjectId findObjectId(java.lang.Object id,
                                      com.fasterxml.jackson.annotation.ObjectIdGenerator<?> gen,
                                      com.fasterxml.jackson.annotation.ObjectIdResolver resolverType)

      Description copied from class: `DeserializationContext`
      Method called to find and return entry corresponding to given Object Id: will add an entry if necessary, and never returns null
      Specified by:
        `findObjectId` in class `DeserializationContext`

    - #### createReadableObjectId

          protected ReadableObjectId createReadableObjectId(com.fasterxml.jackson.annotation.ObjectIdGenerator.IdKey key)

      Overridable factory method to create a new instance of ReadableObjectId or its subclass. It is meant to be overridden when custom ReadableObjectId is needed for `tryToResolveUnresolvedObjectId(com.fasterxml.jackson.databind.deser.impl.ReadableObjectId)`. Default implementation simply constructs default `ReadableObjectId` with given `key`.
      Parameters:
        `key` - The key to associate with the new ReadableObjectId
      Returns:
        New ReadableObjectId instance
      Since:
        2.7

    - #### checkUnresolvedObjectId

          public void checkUnresolvedObjectId()
                                       throws UnresolvedForwardReference

      Description copied from class: `DeserializationContext`
      Method called to ensure that every object id encounter during processing are resolved.
      Specified by:
        `checkUnresolvedObjectId` in class `DeserializationContext`
      Throws:
        `UnresolvedForwardReference`

    - #### tryToResolveUnresolvedObjectId

          protected boolean tryToResolveUnresolvedObjectId(ReadableObjectId roid)

      Overridable helper method called to try to resolve otherwise unresolvable `ReadableObjectId`; and if this succeeds, return `true` to indicate problem has been resolved in some way, so that caller can avoid reporting it as an error.

      Default implementation simply calls `ReadableObjectId.tryToResolveUnresolved(com.fasterxml.jackson.databind.DeserializationContext)` and returns whatever it returns.

      Since:
        2.6

    - #### deserializerInstance

          public JsonDeserializer<java.lang.Object> deserializerInstance(Annotated ann,
                                                                java.lang.Object deserDef)
                                                                  throws JsonMappingException

      Specified by:
        `deserializerInstance` in class `DeserializationContext`
      Throws:
        `JsonMappingException`

    - #### keyDeserializerInstance

          public final KeyDeserializer keyDeserializerInstance(Annotated ann,
                                                java.lang.Object deserDef)
                                                        throws JsonMappingException

      Specified by:
        `keyDeserializerInstance` in class `DeserializationContext`
      Throws:
        `JsonMappingException`

    - #### with

          public abstract DefaultDeserializationContext with(DeserializerFactory factory)

      Fluent factory method used for constructing a blueprint instance with different factory

    - #### createInstance

          public abstract DefaultDeserializationContext createInstance(DeserializationConfig config,
                                                     com.fasterxml.jackson.core.JsonParser jp,
                                                     InjectableValues values)

      Method called to create actual usable per-deserialization context instance.