public class StdDeserializationContext extends DeserializationContext
DeserializationContext.| 限定符和类型 | 字段和说明 |
|---|---|
protected ArrayBuilders |
_arrayBuilders |
protected DateFormat |
_dateFormat |
protected DeserializerProvider |
_deserProvider |
protected InjectableValues |
_injectableValues |
protected ObjectBuffer |
_objectBuffer |
protected JsonParser |
_parser
Currently active parser used for deserialization.
|
_config, _featureFlags| 构造器和说明 |
|---|
StdDeserializationContext(DeserializationConfig config,
JsonParser jp,
DeserializerProvider prov,
InjectableValues injectableValues) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected String |
_calcName(Class<?> cls) |
protected String |
_desc(String desc) |
protected String |
_valueDesc() |
Calendar |
constructCalendar(Date d)
Convenience method for constructing Calendar instance set
to specified time, to be modified and used by caller.
|
protected String |
determineClassName(Object instance) |
Object |
findInjectableValue(Object valueId,
BeanProperty forProperty,
Object beanInstance) |
ArrayBuilders |
getArrayBuilders()
Method for accessing object useful for building arrays of
primitive types (such as int[]).
|
protected DateFormat |
getDateFormat() |
DeserializerProvider |
getDeserializerProvider()
Returns provider that can be used for dynamically locating
other deserializers during runtime.
|
JsonParser |
getParser()
Method for accessing the currently active parser.
|
boolean |
handleUnknownProperty(JsonParser jp,
JsonDeserializer<?> deser,
Object instanceOrClass,
String propName)
Method deserializers can call to inform configured
DeserializationProblemHandlers
of an unrecognized property. |
JsonMappingException |
instantiationException(Class<?> instClass,
String msg) |
JsonMappingException |
instantiationException(Class<?> instClass,
Throwable t)
Helper method for constructing instantiation exception for specified type,
to indicate problem with physically constructing instance of
specified class (missing constructor, exception from constructor)
|
ObjectBuffer |
leaseObjectBuffer()
Method that can be used to get access to a reusable ObjectBuffer,
useful for efficiently constructing Object arrays and Lists.
|
JsonMappingException |
mappingException(Class<?> targetClass)
Helper method for constructing generic mapping exception for specified type
|
JsonMappingException |
mappingException(Class<?> targetClass,
JsonToken token) |
Date |
parseDate(String dateStr)
Convenience method for parsing a Date from given String, using
currently configured date format (accessed using
MapperConfig.getDateFormat()). |
void |
returnObjectBuffer(ObjectBuffer buf)
Method to call to return object buffer previously leased with
DeserializationContext.leaseObjectBuffer(). |
JsonMappingException |
unknownFieldException(Object instanceOrClass,
String fieldName)
Helper method for constructing exception to indicate that JSON Object
field name did not map to a known property of type being
deserialized.
|
JsonMappingException |
unknownTypeException(JavaType type,
String id)
Helper method for constructing exception to indicate that given
type id (parsed from JSON) could not be converted to a Java type.
|
JsonMappingException |
weirdKeyException(Class<?> keyClass,
String keyValue,
String msg)
Helper method for constructing exception to indicate that given JSON
Object field name was not in format to be able to deserialize specified
key type.
|
JsonMappingException |
weirdNumberException(Class<?> instClass,
String msg)
Helper method for constructing exception to indicate that input JSON
Number was not suitable for deserializing into given type.
|
JsonMappingException |
weirdStringException(Class<?> instClass,
String msg)
Method that will construct an exception suitable for throwing when
some String values are acceptable, but the one encountered is not
|
JsonMappingException |
wrongTokenException(JsonParser jp,
JsonToken expToken,
String msg)
Helper method for indicating that the current token was expected to be another
token.
|
constructType, getBase64Variant, getConfig, getNodeFactory, getTypeFactory, isEnabled, mappingExceptionprotected JsonParser _parser
protected final DeserializerProvider _deserProvider
protected final InjectableValues _injectableValues
protected ArrayBuilders _arrayBuilders
protected ObjectBuffer _objectBuffer
protected DateFormat _dateFormat
public StdDeserializationContext(DeserializationConfig config, JsonParser jp, DeserializerProvider prov, InjectableValues injectableValues)
public DeserializerProvider getDeserializerProvider()
DeserializationContextpublic JsonParser getParser()
Use of this method is discouraged: if code has direct access to the active parser, that should be used instead.
getParser 在类中 DeserializationContextpublic Object findInjectableValue(Object valueId, BeanProperty forProperty, Object beanInstance)
public final ObjectBuffer leaseObjectBuffer()
DeserializationContextleaseObjectBuffer 在类中 DeserializationContextpublic final void returnObjectBuffer(ObjectBuffer buf)
DeserializationContextDeserializationContext.leaseObjectBuffer().returnObjectBuffer 在类中 DeserializationContextbuf - Returned object bufferpublic final ArrayBuilders getArrayBuilders()
DeserializationContextgetArrayBuilders 在类中 DeserializationContextpublic Date parseDate(String dateStr) throws IllegalArgumentException
DeserializationContextMapperConfig.getDateFormat()).
Implementation will handle thread-safety issues related to date formats such that first time this method is called, date format is cloned, and cloned instance will be retained for use during this deserialization round.
parseDate 在类中 DeserializationContextIllegalArgumentExceptionpublic Calendar constructCalendar(Date d)
DeserializationContextconstructCalendar 在类中 DeserializationContextpublic boolean handleUnknownProperty(JsonParser jp, JsonDeserializer<?> deser, Object instanceOrClass, String propName) throws IOException, JsonProcessingException
DeserializationProblemHandlers
of an unrecognized property.handleUnknownProperty 在类中 DeserializationContextIOExceptionJsonProcessingExceptionpublic JsonMappingException mappingException(Class<?> targetClass)
DeserializationContextmappingException 在类中 DeserializationContextpublic JsonMappingException mappingException(Class<?> targetClass, JsonToken token)
mappingException 在类中 DeserializationContextpublic JsonMappingException instantiationException(Class<?> instClass, Throwable t)
DeserializationContextpublic JsonMappingException instantiationException(Class<?> instClass, String msg)
public JsonMappingException weirdStringException(Class<?> instClass, String msg)
public JsonMappingException weirdNumberException(Class<?> instClass, String msg)
DeserializationContextpublic JsonMappingException weirdKeyException(Class<?> keyClass, String keyValue, String msg)
DeserializationContextweirdKeyException 在类中 DeserializationContextpublic JsonMappingException wrongTokenException(JsonParser jp, JsonToken expToken, String msg)
DeserializationContextpublic JsonMappingException unknownFieldException(Object instanceOrClass, String fieldName)
DeserializationContextunknownFieldException 在类中 DeserializationContextinstanceOrClass - Either value being populated (if one has been
instantiated), or Class that indicates type that would be (or
have been) instantiatedpublic JsonMappingException unknownTypeException(JavaType type, String id)
DeserializationContextprotected DateFormat getDateFormat()
protected String _valueDesc()