StdDeserializer
Date: 2016-12-04

com.fasterxml.jackson.databind.deser.std

## Class StdDeserializer<T>

- java.lang.Object
- - com.fasterxml.jackson.databind.JsonDeserializer<T>
  - - com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    BeanDeserializerBase, ContainerDeserializerBase, DelegatingDeserializer, EnumSetDeserializer, FailingDeserializer, JsonNodeDeserializer, NullifyingDeserializer, PrimitiveArrayDeserializers, ReferenceTypeDeserializer, StdDelegatingDeserializer, StdNodeBasedDeserializer, StdScalarDeserializer, StringArrayDeserializer, UntypedObjectDeserializer, UntypedObjectDeserializer.Vanilla

      public abstract class StdDeserializer<T>
      extends JsonDeserializer<T>
      implements java.io.Serializable

  Base class for common deserializers. Contains shared base functionality for dealing with primitive values, such as (re)parsing from String.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer

      `JsonDeserializer.None`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.lang.Class<?>` | `_valueClass` Type of values this deserializer handles: sometimes exact types, other time most specific supertype of types deserializer handles (which may be as generic as `Object` in some case)
    `protected static int` | `F_MASK_INT_COERCIONS` Bitmask that covers `DeserializationFeature.USE_BIG_INTEGER_FOR_INTS` and `DeserializationFeature.USE_LONG_FOR_INTS`, used for more efficient cheks when coercing integral values for untyped deserialization.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `StdDeserializer(java.lang.Class<?> vc)`
    `protected` | `StdDeserializer(JavaType valueType)`
    `protected` | `StdDeserializer(StdDeserializer<?> src)` Copy-constructor for sub-classes to use, most often when creating new instances for `ContextualDeserializer`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.Object` | `_coerceIntegral(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)` Helper method called in case where an integral number is encountered, but config settings suggest that a coercion may be needed to "upgrade" `Number` into "bigger" type like `Long` or `BigInteger`
    `protected T` | `_deserializeFromEmpty(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)` Helper method that may be used to support fallback for Empty String / Empty Array non-standard representations; usually for things serialized as JSON Objects.
    `protected void` | `_failDoubleToIntCoercion(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt, java.lang.String type)`
    `protected boolean` | `_hasTextualNull(java.lang.String value)` Helper method called to determine if we are seeing String value of "null", and, further, that it should be coerced to null just like null token.
    `protected boolean` | `_isIntNumber(java.lang.String text)` Helper method to check whether given text refers to what looks like a clean simple integer number, consisting of optional sign followed by a sequence of digits.
    `protected boolean` | `_isNaN(java.lang.String text)`
    `protected boolean` | `_isNegInf(java.lang.String text)`
    `protected boolean` | `_isPosInf(java.lang.String text)`
    `protected java.lang.Boolean` | `_parseBoolean(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected boolean` | `_parseBooleanFromInt(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected boolean` | `_parseBooleanFromOther(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)` Deprecated.
    `protected boolean` | `_parseBooleanPrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.Byte` | `_parseByte(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.util.Date` | `_parseDate(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.util.Date` | `_parseDate(java.lang.String value, DeserializationContext ctxt)`
    `protected java.lang.Double` | `_parseDouble(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected double` | `_parseDoublePrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.Float` | `_parseFloat(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected float` | `_parseFloatPrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.Integer` | `_parseInteger(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected int` | `_parseIntPrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.Long` | `_parseLong(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected long` | `_parseLongPrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.Short` | `_parseShort(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected short` | `_parseShortPrimitive(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected java.lang.String` | `_parseString(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)` Helper method used for accessing String value, if possible, doing necessary conversion or throwing exception as necessary.
    `java.lang.Object` | `deserializeWithType(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt, TypeDeserializer typeDeserializer)` Base implementation that does not assume specific type inclusion mechanism.
    `protected JsonDeserializer<?>` | `findConvertingContentDeserializer(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?> existingDeserializer)` Helper method that can be used to see if specified property has annotation indicating that a converter is to be used for contained values (contents of structured types; array/List/Map values)
    `protected JsonDeserializer<java.lang.Object>` | `findDeserializer(DeserializationContext ctxt, JavaType type, BeanProperty property)` Helper method used to locate deserializers for properties the type this deserializer handles contains (usually for properties of bean types)
    `protected java.lang.Boolean` | `findFormatFeature(DeserializationContext ctxt, BeanProperty prop, java.lang.Class<?> typeForDefaults, com.fasterxml.jackson.annotation.JsonFormat.Feature feat)` Convenience method that uses `findFormatOverrides(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty, java.lang.Class<?>)` to find possible defaults and/of overrides, and then calls `JsonFormat.Value.getFeature(feat)` to find whether that feature has been specifically marked as enabled or disabled.
    `protected com.fasterxml.jackson.annotation.JsonFormat.Value` | `findFormatOverrides(DeserializationContext ctxt, BeanProperty prop, java.lang.Class<?> typeForDefaults)` Helper method that may be used to find if this deserializer has specific `JsonFormat` settings, either via property, or through type-specific defaulting.
    `java.lang.Class<?>` | `getValueClass()` Deprecated. Since 2.3 use `handledType()` instead
    `JavaType` | `getValueType()` Exact structured type deserializer handles, if known.
    `java.lang.Class<?>` | `handledType()` Method for accessing type of values this deserializer produces.
    `protected void` | `handleMissingEndArrayForSingle(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
    `protected void` | `handleUnknownProperty(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt, java.lang.Object instanceOrClass, java.lang.String propName)` Method called to deal with a property that did not map to a known Bean property.
    `protected boolean` | `isDefaultDeserializer(JsonDeserializer<?> deserializer)` Method that can be called to determine if given deserializer is the default deserializer Jackson uses; as opposed to a custom deserializer installed by a module or calling application.
    `protected boolean` | `isDefaultKeyDeserializer(KeyDeserializer keyDeser)`
    `protected static double` | `parseDouble(java.lang.String numStr)` Helper method for encapsulating calls to low-level double value parsing; single place just because we need a work-around that must be applied to all calls.

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

      `deserialize, deserialize, findBackReference, getDelegatee, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullValue, getNullValue, getObjectIdReader, isCachable, replaceDelegatee, unwrappingDeserializer`

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

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

- - ### Field Detail

    - #### F_MASK_INT_COERCIONS

          protected static final int F_MASK_INT_COERCIONS

      Bitmask that covers `DeserializationFeature.USE_BIG_INTEGER_FOR_INTS` and `DeserializationFeature.USE_LONG_FOR_INTS`, used for more efficient cheks when coercing integral values for untyped deserialization.
      Since:
        2.6

    - #### _valueClass

          protected final java.lang.Class<?> _valueClass

      Type of values this deserializer handles: sometimes exact types, other time most specific supertype of types deserializer handles (which may be as generic as `Object` in some case)

  - ### Constructor Detail

    - #### StdDeserializer

          protected StdDeserializer(java.lang.Class<?> vc)

    - #### StdDeserializer

          protected StdDeserializer(JavaType valueType)

    - #### StdDeserializer

          protected StdDeserializer(StdDeserializer<?> src)

      Copy-constructor for sub-classes to use, most often when creating new instances for `ContextualDeserializer`.
      Since:
        2.5

  - ### Method Detail

    - #### handledType

          public java.lang.Class<?> handledType()

      Description copied from class: `JsonDeserializer`
      Method for accessing type of values this deserializer produces. Note that this information is not guaranteed to be exact -- it may be a more generic (super-type) -- but it should not be incorrect (return a non-related type).

      Default implementation will return null, which means almost same same as returning `Object.class` would; that is, that nothing is known about handled type.

      Overrides:
        `handledType` in class `JsonDeserializer<T>`

    - #### getValueClass

          @Deprecated
          public final java.lang.Class<?> getValueClass()

      Deprecated. Since 2.3 use `handledType()` instead

    - #### getValueType

          public JavaType getValueType()

      Exact structured type deserializer handles, if known.

      Default implementation just returns null.

    - #### isDefaultDeserializer

          protected boolean isDefaultDeserializer(JsonDeserializer<?> deserializer)

      Method that can be called to determine if given deserializer is the default deserializer Jackson uses; as opposed to a custom deserializer installed by a module or calling application. Determination is done using `JacksonStdImpl` annotation on deserializer class.

    - #### isDefaultKeyDeserializer

          protected boolean isDefaultKeyDeserializer(KeyDeserializer keyDeser)

    - #### deserializeWithType

          public java.lang.Object deserializeWithType(com.fasterxml.jackson.core.JsonParser p,
                                             DeserializationContext ctxt,
                                             TypeDeserializer typeDeserializer)
                                               throws java.io.IOException

      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.
      Overrides:
        `deserializeWithType` in class `JsonDeserializer<T>`
        `typeDeserializer` - Deserializer to use for handling type information
      Throws:
        `java.io.IOException`

    - #### _parseBooleanPrimitive

          protected final boolean _parseBooleanPrimitive(com.fasterxml.jackson.core.JsonParser p,
                                       DeserializationContext ctxt)
                                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseBoolean

          protected final java.lang.Boolean _parseBoolean(com.fasterxml.jackson.core.JsonParser p,
                                        DeserializationContext ctxt)
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseBooleanFromInt

          protected boolean _parseBooleanFromInt(com.fasterxml.jackson.core.JsonParser p,
                                     DeserializationContext ctxt)
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseBooleanFromOther

          @Deprecated
          protected boolean _parseBooleanFromOther(com.fasterxml.jackson.core.JsonParser p,
                                                  DeserializationContext ctxt)
                                            throws java.io.IOException

      Deprecated.
      Throws:
        `java.io.IOException`

    - #### _parseByte

          protected java.lang.Byte _parseByte(com.fasterxml.jackson.core.JsonParser p,
                                  DeserializationContext ctxt)
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseShort

          protected java.lang.Short _parseShort(com.fasterxml.jackson.core.JsonParser p,
                                    DeserializationContext ctxt)
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseShortPrimitive

          protected final short _parseShortPrimitive(com.fasterxml.jackson.core.JsonParser p,
                                   DeserializationContext ctxt)
                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseIntPrimitive

          protected final int _parseIntPrimitive(com.fasterxml.jackson.core.JsonParser p,
                               DeserializationContext ctxt)
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseInteger

          protected final java.lang.Integer _parseInteger(com.fasterxml.jackson.core.JsonParser p,
                                        DeserializationContext ctxt)
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseLong

          protected final java.lang.Long _parseLong(com.fasterxml.jackson.core.JsonParser p,
                                  DeserializationContext ctxt)
                                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseLongPrimitive

          protected final long _parseLongPrimitive(com.fasterxml.jackson.core.JsonParser p,
                                 DeserializationContext ctxt)
                                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseFloat

          protected final java.lang.Float _parseFloat(com.fasterxml.jackson.core.JsonParser p,
                                    DeserializationContext ctxt)
                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseFloatPrimitive

          protected final float _parseFloatPrimitive(com.fasterxml.jackson.core.JsonParser p,
                                   DeserializationContext ctxt)
                                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseDouble

          protected final java.lang.Double _parseDouble(com.fasterxml.jackson.core.JsonParser p,
                                      DeserializationContext ctxt)
                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseDoublePrimitive

          protected final double _parseDoublePrimitive(com.fasterxml.jackson.core.JsonParser p,
                                     DeserializationContext ctxt)
                                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseDate

          protected java.util.Date _parseDate(com.fasterxml.jackson.core.JsonParser p,
                                  DeserializationContext ctxt)
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _parseDate

          protected java.util.Date _parseDate(java.lang.String value,
                                  DeserializationContext ctxt)
                                       throws java.io.IOException

      Throws:
        `java.io.IOException`
      Since:
        2.8

    - #### parseDouble

          protected static final double parseDouble(java.lang.String numStr)
                                             throws java.lang.NumberFormatException

      Helper method for encapsulating calls to low-level double value parsing; single place just because we need a work-around that must be applied to all calls.
      Throws:
        `java.lang.NumberFormatException`

    - #### _parseString

          protected final java.lang.String _parseString(com.fasterxml.jackson.core.JsonParser p,
                                      DeserializationContext ctxt)
                                                 throws java.io.IOException

      Helper method used for accessing String value, if possible, doing necessary conversion or throwing exception as necessary.
      Throws:
        `java.io.IOException`
      Since:
        2.1

    - #### _deserializeFromEmpty

          protected T _deserializeFromEmpty(com.fasterxml.jackson.core.JsonParser p,
                                DeserializationContext ctxt)
                                     throws java.io.IOException

      Helper method that may be used to support fallback for Empty String / Empty Array non-standard representations; usually for things serialized as JSON Objects.
      Throws:
        `java.io.IOException`
      Since:
        2.5

    - #### _hasTextualNull

          protected boolean _hasTextualNull(java.lang.String value)

      Helper method called to determine if we are seeing String value of "null", and, further, that it should be coerced to null just like null token.
      Since:
        2.3

    - #### _isNegInf

          protected final boolean _isNegInf(java.lang.String text)

    - #### _isPosInf

          protected final boolean _isPosInf(java.lang.String text)

    - #### _isNaN

          protected final boolean _isNaN(java.lang.String text)

    - #### _coerceIntegral

          protected java.lang.Object _coerceIntegral(com.fasterxml.jackson.core.JsonParser p,
                                         DeserializationContext ctxt)
                                              throws java.io.IOException

      Helper method called in case where an integral number is encountered, but config settings suggest that a coercion may be needed to "upgrade" `Number` into "bigger" type like `Long` or `BigInteger`
      Throws:
        `java.io.IOException`
      Since:
        2.6
      See Also:
        `DeserializationFeature.USE_BIG_INTEGER_FOR_INTS`, `DeserializationFeature.USE_LONG_FOR_INTS`

    - #### findDeserializer

          protected JsonDeserializer<java.lang.Object> findDeserializer(DeserializationContext ctxt,
                                                            JavaType type,
                                                            BeanProperty property)
                                                                 throws JsonMappingException

      Helper method used to locate deserializers for properties the type this deserializer handles contains (usually for properties of bean types)
      Parameters:
        `type` - Type of property to deserialize
        `property` - Actual property object (field, method, constuctor parameter) used for passing deserialized values; provided so deserializer can be contextualized if necessary
      Throws:
        `JsonMappingException`

    - #### _isIntNumber

          protected final boolean _isIntNumber(java.lang.String text)

      Helper method to check whether given text refers to what looks like a clean simple integer number, consisting of optional sign followed by a sequence of digits.

    - #### findConvertingContentDeserializer

          protected JsonDeserializer<?> findConvertingContentDeserializer(DeserializationContext ctxt,
                                                              BeanProperty prop,
                                                              JsonDeserializer<?> existingDeserializer)
                                                                   throws JsonMappingException

      Helper method that can be used to see if specified property has annotation indicating that a converter is to be used for contained values (contents of structured types; array/List/Map values)
      Parameters:
        `existingDeserializer` - (optional) configured content serializer if one already exists.
      Throws:
        `JsonMappingException`
      Since:
        2.2

    - #### findFormatOverrides

          protected com.fasterxml.jackson.annotation.JsonFormat.Value findFormatOverrides(DeserializationContext ctxt,
                                                                              BeanProperty prop,
                                                                              java.lang.Class<?> typeForDefaults)

      Helper method that may be used to find if this deserializer has specific `JsonFormat` settings, either via property, or through type-specific defaulting.
      Parameters:
        `typeForDefaults` - Type (erased) used for finding default format settings, if any
      Since:
        2.7

    - #### findFormatFeature

          protected java.lang.Boolean findFormatFeature(DeserializationContext ctxt,
                                            BeanProperty prop,
                                            java.lang.Class<?> typeForDefaults,
                                            com.fasterxml.jackson.annotation.JsonFormat.Feature feat)

      Convenience method that uses `findFormatOverrides(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty, java.lang.Class<?>)` to find possible defaults and/of overrides, and then calls `JsonFormat.Value.getFeature(feat)` to find whether that feature has been specifically marked as enabled or disabled.
      Parameters:
        `typeForDefaults` - Type (erased) used for finding default format settings, if any
      Since:
        2.7

    - #### handleUnknownProperty

          protected void handleUnknownProperty(com.fasterxml.jackson.core.JsonParser p,
                                   DeserializationContext ctxt,
                                   java.lang.Object instanceOrClass,
                                   java.lang.String propName)
                                        throws java.io.IOException

      Method called to deal with a property that did not map to a known Bean property. Method can deal with the problem as it sees fit (ignore, throw exception); but if it does return, it has to skip the matching Json content parser has.
      Parameters:
        `p` - Parser that points to value of the unknown property
        `ctxt` - Context for deserialization; allows access to the parser, error reporting functionality
        `instanceOrClass` - Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is what `getValueClass()` returns.
        `propName` - Name of the property that can not be mapped
      Throws:
        `java.io.IOException`

    - #### handleMissingEndArrayForSingle

          protected void handleMissingEndArrayForSingle(com.fasterxml.jackson.core.JsonParser p,
                                            DeserializationContext ctxt)
                                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### _failDoubleToIntCoercion

          protected void _failDoubleToIntCoercion(com.fasterxml.jackson.core.JsonParser p,
                                      DeserializationContext ctxt,
                                      java.lang.String type)
                                           throws java.io.IOException

      Throws:
        `java.io.IOException`