Class AsStringDeserializer

java.lang.Object
tools.jackson.databind.ValueDeserializer<Long>
me.ahoo.cosid.jackson.AsStringDeserializer
All Implemented Interfaces:
tools.jackson.databind.deser.NullValueProvider

public class AsStringDeserializer extends tools.jackson.databind.ValueDeserializer<Long>
Reads an AsString id. A JSON string is decoded, an empty one is null; a JSON number is the id itself if the codec could have written it. Text the codec cannot read is reported through DeserializationContext.handleWeirdStringValue(java.lang.Class<?>, java.lang.String, java.lang.String, java.lang.Object...), an InvalidFormatException (a client error) by default. A null (or empty text) for a long follows DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES: an input error when it is enabled, 0 otherwise, as Jackson reads a plain long.
  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.databind.ValueDeserializer

    tools.jackson.databind.ValueDeserializer.None
  • Constructor Summary

    Constructors
    Constructor
    Description
    A deserializer of decimal text, without a runtime: what @JsonDeserialize(using = ...) creates.
  • Method Summary

    Modifier and Type
    Method
    Description
    tools.jackson.databind.ValueDeserializer<?>
    createContextual(tools.jackson.databind.DeserializationContext ctxt, tools.jackson.databind.BeanProperty property)
     
    deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt)
     
    deserializeWithType(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt, tools.jackson.databind.jsontype.TypeDeserializer typeDeserializer)
    Reads an id with its type id (@JsonTypeInfo).
    tools.jackson.databind.util.AccessPattern
     
    getNullValue(tools.jackson.databind.DeserializationContext ctxt)
    null for a Long; for a long, an input error when DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES is enabled, 0 otherwise (#1439).
     

    Methods inherited from class tools.jackson.databind.ValueDeserializer

    deserialize, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getObjectIdReader, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AsStringDeserializer

      public AsStringDeserializer()
      A deserializer of decimal text, without a runtime: what @JsonDeserialize(using = ...) creates.
  • Method Details

    • createContextual

      public tools.jackson.databind.ValueDeserializer<?> createContextual(tools.jackson.databind.DeserializationContext ctxt, tools.jackson.databind.BeanProperty property)
      Overrides:
      createContextual in class tools.jackson.databind.ValueDeserializer<Long>
    • deserialize

      public Long deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt)
      Specified by:
      deserialize in class tools.jackson.databind.ValueDeserializer<Long>
    • deserializeWithType

      public Object deserializeWithType(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt, tools.jackson.databind.jsontype.TypeDeserializer typeDeserializer)
      Reads an id with its type id (@JsonTypeInfo). The type id of a Long is metadata only: the value is read with the codec, not with the deserializer the type id names, which knows no codec (#1460). A scalar's type id wraps it in an array (WRAPPER_ARRAY, and PROPERTY, which a scalar falls back to) or an object (WRAPPER_OBJECT); with any other inclusion the value stands alone.
      Overrides:
      deserializeWithType in class tools.jackson.databind.ValueDeserializer<Long>
    • getNullValue

      public Long getNullValue(tools.jackson.databind.DeserializationContext ctxt)
      null for a Long; for a long, an input error when DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES is enabled, 0 otherwise (#1439).
      Specified by:
      getNullValue in interface tools.jackson.databind.deser.NullValueProvider
      Overrides:
      getNullValue in class tools.jackson.databind.ValueDeserializer<Long>
    • getNullAccessPattern

      public tools.jackson.databind.util.AccessPattern getNullAccessPattern()
      Specified by:
      getNullAccessPattern in interface tools.jackson.databind.deser.NullValueProvider
      Overrides:
      getNullAccessPattern in class tools.jackson.databind.ValueDeserializer<Long>
    • handledType

      public Class<?> handledType()
      Overrides:
      handledType in class tools.jackson.databind.ValueDeserializer<Long>