public abstract class StdDeserializer<T> extends JsonDeserializer<T> implements Serializable
JsonDeserializer.None
Modifier and Type | Field and Description |
---|---|
protected 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. |
Modifier | Constructor and Description |
---|---|
protected |
StdDeserializer(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 . |
Modifier and Type | Method and Description |
---|---|
protected Object |
_coerceIntegral(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(JsonParser jp,
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(JsonParser jp,
DeserializationContext ctxt,
String type) |
protected boolean |
_hasTextualNull(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(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(String text) |
protected boolean |
_isNegInf(String text) |
protected boolean |
_isPosInf(String text) |
protected Boolean |
_parseBoolean(JsonParser p,
DeserializationContext ctxt) |
protected boolean |
_parseBooleanFromOther(JsonParser p,
DeserializationContext ctxt) |
protected boolean |
_parseBooleanPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Byte |
_parseByte(JsonParser p,
DeserializationContext ctxt) |
protected Date |
_parseDate(JsonParser p,
DeserializationContext ctxt) |
protected Double |
_parseDouble(JsonParser jp,
DeserializationContext ctxt) |
protected double |
_parseDoublePrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Float |
_parseFloat(JsonParser jp,
DeserializationContext ctxt) |
protected float |
_parseFloatPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Integer |
_parseInteger(JsonParser p,
DeserializationContext ctxt) |
protected int |
_parseIntPrimitive(JsonParser p,
DeserializationContext ctxt) |
protected Long |
_parseLong(JsonParser p,
DeserializationContext ctxt) |
protected long |
_parseLongPrimitive(JsonParser p,
DeserializationContext ctxt) |
protected Short |
_parseShort(JsonParser p,
DeserializationContext ctxt) |
protected short |
_parseShortPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected String |
_parseString(JsonParser p,
DeserializationContext ctxt)
Helper method used for accessing String value, if possible, doing
necessary conversion or throwing exception as necessary.
|
Object |
deserializeWithType(JsonParser jp,
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<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 Boolean |
findFormatFeature(DeserializationContext ctxt,
BeanProperty prop,
Class<?> typeForDefaults,
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 JsonFormat.Value |
findFormatOverrides(DeserializationContext ctxt,
BeanProperty prop,
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. |
Class<?> |
getValueClass()
Deprecated.
Since 2.3 use
handledType() instead |
JavaType |
getValueType()
Exact structured type deserializer handles, if known.
|
Class<?> |
handledType()
Method for accessing type of values this deserializer produces.
|
protected void |
handleUnknownProperty(JsonParser jp,
DeserializationContext ctxt,
Object instanceOrClass,
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(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.
|
deserialize, deserialize, findBackReference, getDelegatee, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullValue, getNullValue, getObjectIdReader, isCachable, replaceDelegatee, unwrappingDeserializer
protected static final int F_MASK_INT_COERCIONS
DeserializationFeature.USE_BIG_INTEGER_FOR_INTS
and DeserializationFeature.USE_LONG_FOR_INTS
, used for more efficient
cheks when coercing integral values for untyped deserialization.protected StdDeserializer(Class<?> vc)
protected StdDeserializer(JavaType valueType)
protected StdDeserializer(StdDeserializer<?> src)
ContextualDeserializer
.public Class<?> handledType()
JsonDeserializer
Default implementation will return null, which means almost same
same as returning Object.class
would; that is, that
nothing is known about handled type.
handledType
in class JsonDeserializer<T>
@Deprecated public final Class<?> getValueClass()
handledType()
insteadpublic JavaType getValueType()
Default implementation just returns null.
protected boolean isDefaultDeserializer(JsonDeserializer<?> deserializer)
JacksonStdImpl
annotation on deserializer class.protected boolean isDefaultKeyDeserializer(KeyDeserializer keyDeser)
public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException
deserializeWithType
in class JsonDeserializer<T>
typeDeserializer
- Deserializer to use for handling type informationIOException
protected final boolean _parseBooleanPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected final Boolean _parseBoolean(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final boolean _parseBooleanFromOther(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected Byte _parseByte(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected Short _parseShort(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final short _parseShortPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected final int _parseIntPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final Integer _parseInteger(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final Long _parseLong(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final long _parseLongPrimitive(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected final Float _parseFloat(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected final float _parseFloatPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected final Double _parseDouble(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected final double _parseDoublePrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected Date _parseDate(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected static final double parseDouble(String numStr) throws NumberFormatException
NumberFormatException
protected final String _parseString(JsonParser p, DeserializationContext ctxt) throws IOException
IOException
protected T _deserializeFromEmpty(JsonParser jp, DeserializationContext ctxt) throws IOException
IOException
protected boolean _hasTextualNull(String value)
protected final boolean _isNegInf(String text)
protected final boolean _isPosInf(String text)
protected final boolean _isNaN(String text)
protected Object _coerceIntegral(JsonParser p, DeserializationContext ctxt) throws IOException
Number
into "bigger" type like Long
or
BigInteger
IOException
DeserializationFeature.USE_BIG_INTEGER_FOR_INTS
,
DeserializationFeature.USE_LONG_FOR_INTS
protected JsonDeserializer<Object> findDeserializer(DeserializationContext ctxt, JavaType type, BeanProperty property) throws JsonMappingException
type
- Type of property to deserializeproperty
- Actual property object (field, method, constuctor parameter) used
for passing deserialized values; provided so deserializer can be contextualized if necessaryJsonMappingException
protected final boolean _isIntNumber(String text)
protected JsonDeserializer<?> findConvertingContentDeserializer(DeserializationContext ctxt, BeanProperty prop, JsonDeserializer<?> existingDeserializer) throws JsonMappingException
existingDeserializer
- (optional) configured content
serializer if one already exists.JsonMappingException
protected JsonFormat.Value findFormatOverrides(DeserializationContext ctxt, BeanProperty prop, Class<?> typeForDefaults)
JsonFormat
settings, either via property, or through type-specific
defaulting.typeForDefaults
- Type (erased) used for finding default format settings, if anyprotected Boolean findFormatFeature(DeserializationContext ctxt, BeanProperty prop, Class<?> typeForDefaults, JsonFormat.Feature feat)
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.typeForDefaults
- Type (erased) used for finding default format settings, if anyprotected void handleUnknownProperty(JsonParser jp, DeserializationContext ctxt, Object instanceOrClass, String propName) throws IOException
NOTE: method signature was changed in version 1.5; explicit JsonParser must be passed since it may be something other than what context has. Prior versions did not include the first parameter.
jp
- Parser that points to value of the unknown propertyctxt
- Context for deserialization; allows access to the parser,
error reporting functionalityinstanceOrClass
- 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 mappedIOException
protected void _failDoubleToIntCoercion(JsonParser jp, DeserializationContext ctxt, String type) throws IOException
IOException
Copyright © 2008–2018 FasterXML. All rights reserved.