Package me.ahoo.cosid.jackson
Class AsStringDeserializer
java.lang.Object
tools.jackson.databind.ValueDeserializer<Long>
me.ahoo.cosid.jackson.AsStringDeserializer
- All Implemented Interfaces:
tools.jackson.databind.deser.NullValueProvider
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
ConstructorsConstructorDescriptionA deserializer of decimal text, without a runtime: what@JsonDeserialize(using = ...)creates. -
Method Summary
Modifier and TypeMethodDescriptiontools.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.AccessPatterngetNullValue(tools.jackson.databind.DeserializationContext ctxt) nullfor aLong; for along, an input error whenDeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVESis enabled, 0 otherwise (#1439).Class<?> Methods inherited from class tools.jackson.databind.ValueDeserializer
deserialize, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getKnownPropertyNames, getObjectIdReader, isCachable, logicalType, replaceDelegatee, resolve, supportsUpdate, unwrappingDeserializer
-
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:
createContextualin classtools.jackson.databind.ValueDeserializer<Long>
-
deserialize
public Long deserialize(tools.jackson.core.JsonParser p, tools.jackson.databind.DeserializationContext ctxt) - Specified by:
deserializein classtools.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 aLongis 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, andPROPERTY, which a scalar falls back to) or an object (WRAPPER_OBJECT); with any other inclusion the value stands alone.- Overrides:
deserializeWithTypein classtools.jackson.databind.ValueDeserializer<Long>
-
getNullValue
nullfor aLong; for along, an input error whenDeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVESis enabled, 0 otherwise (#1439).- Specified by:
getNullValuein interfacetools.jackson.databind.deser.NullValueProvider- Overrides:
getNullValuein classtools.jackson.databind.ValueDeserializer<Long>
-
getNullAccessPattern
public tools.jackson.databind.util.AccessPattern getNullAccessPattern()- Specified by:
getNullAccessPatternin interfacetools.jackson.databind.deser.NullValueProvider- Overrides:
getNullAccessPatternin classtools.jackson.databind.ValueDeserializer<Long>
-
handledType
- Overrides:
handledTypein classtools.jackson.databind.ValueDeserializer<Long>
-