public abstract class StdDeserializer<T> extends JsonDeserializer<T>
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) |
| Modifier | Constructor and Description |
|---|---|
protected |
StdDeserializer(Class<?> vc) |
protected |
StdDeserializer(JavaType valueType) |
| Modifier and Type | Method and Description |
|---|---|
protected Boolean |
_parseBoolean(JsonParser jp,
DeserializationContext ctxt) |
protected boolean |
_parseBooleanFromNumber(JsonParser jp,
DeserializationContext ctxt) |
protected boolean |
_parseBooleanPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Byte |
_parseByte(JsonParser jp,
DeserializationContext ctxt) |
protected Date |
_parseDate(JsonParser jp,
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 jp,
DeserializationContext ctxt) |
protected int |
_parseIntPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Long |
_parseLong(JsonParser jp,
DeserializationContext ctxt) |
protected long |
_parseLongPrimitive(JsonParser jp,
DeserializationContext ctxt) |
protected Short |
_parseShort(JsonParser jp,
DeserializationContext ctxt) |
protected short |
_parseShortPrimitive(JsonParser jp,
DeserializationContext ctxt) |
Object |
deserializeWithType(JsonParser jp,
DeserializationContext ctxt,
TypeDeserializer typeDeserializer)
Base implementation that does not assume specific type
inclusion mechanism.
|
protected JsonDeserializer<Object> |
findDeserializer(DeserializationConfig config,
DeserializerProvider provider,
JavaType type,
BeanProperty property)
Helper method used to locate deserializers for properties the
type this deserializer handles contains (usually for properties of
bean types)
|
Class<?> |
getValueClass() |
JavaType |
getValueType()
Exact structured type deserializer handles, if known.
|
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 |
isDefaultSerializer(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 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.
|
protected void |
reportUnknownProperty(DeserializationContext ctxt,
Object instanceOrClass,
String fieldName) |
deserialize, deserialize, getEmptyValue, getNullValue, unwrappingDeserializerprotected StdDeserializer(Class<?> vc)
protected StdDeserializer(JavaType valueType)
public Class<?> getValueClass()
public JavaType getValueType()
Default implementation just returns null.
protected boolean isDefaultSerializer(JsonDeserializer<?> deserializer)
JacksonStdImpl annotation on deserializer class.public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, JsonProcessingException
deserializeWithType in class JsonDeserializer<T>typeDeserializer - Deserializer to use for handling type informationIOExceptionJsonProcessingExceptionprotected final boolean _parseBooleanPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final Boolean _parseBoolean(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final boolean _parseBooleanFromNumber(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected Byte _parseByte(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected Short _parseShort(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final short _parseShortPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final int _parseIntPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final Integer _parseInteger(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final Long _parseLong(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final long _parseLongPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final Float _parseFloat(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final float _parseFloatPrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final Double _parseDouble(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected final double _parseDoublePrimitive(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected Date _parseDate(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException
IOExceptionJsonProcessingExceptionprotected static final double parseDouble(String numStr) throws NumberFormatException
Note: copied from org.codehaus.jackson.io.NumberUtil (to avoid dependency to
version 1.8; except for String constants, but that gets compiled in bytecode here)
NumberFormatExceptionprotected JsonDeserializer<Object> findDeserializer(DeserializationConfig config, DeserializerProvider provider, JavaType type, BeanProperty property) throws JsonMappingException
config - Active deserialization configurationprovider - Deserializer provider to use for actually finding deserializer(s)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 necessary (since 1.7)JsonMappingExceptionprotected void handleUnknownProperty(JsonParser jp, DeserializationContext ctxt, Object instanceOrClass, String propName) throws IOException, JsonProcessingException
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 mappedIOExceptionJsonProcessingExceptionprotected void reportUnknownProperty(DeserializationContext ctxt, Object instanceOrClass, String fieldName) throws IOException, JsonProcessingException
IOExceptionJsonProcessingException