Class StdDeserializationContext
java.lang.Object
org.codehaus.jackson.map.DeserializationContext
org.codehaus.jackson.map.deser.StdDeserializationContext
Default implementation of
DeserializationContext.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayBuildersprotected DateFormatprotected final DeserializerProviderprotected final InjectableValuesprotected ObjectBufferprotected JsonParserCurrently active parser used for deserialization.Fields inherited from class DeserializationContext
_config, _featureFlags -
Constructor Summary
ConstructorsConstructorDescriptionStdDeserializationContext(DeserializationConfig config, JsonParser jp, DeserializerProvider prov, InjectableValues injectableValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected Stringprotected StringConvenience method for constructing Calendar instance set to specified time, to be modified and used by caller.protected StringdetermineClassName(Object instance) findInjectableValue(Object valueId, BeanProperty forProperty, Object beanInstance) final ArrayBuildersMethod for accessing object useful for building arrays of primitive types (such as int[]).protected DateFormatReturns provider that can be used for dynamically locating other deserializers during runtime.Method for accessing the currently active parser.booleanhandleUnknownProperty(JsonParser jp, JsonDeserializer<?> deser, Object instanceOrClass, String propName) Method deserializers can call to inform configuredDeserializationProblemHandlers of an unrecognized property.instantiationException(Class<?> instClass, String msg) 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)final ObjectBufferMethod that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists.mappingException(Class<?> targetClass) Helper method for constructing generic mapping exception for specified typemappingException(Class<?> targetClass, JsonToken token) Convenience method for parsing a Date from given String, using currently configured date format (accessed usingMapperConfig.getDateFormat()).final voidMethod to call to return object buffer previously leased withDeserializationContext.leaseObjectBuffer().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.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.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.weirdNumberException(Class<?> instClass, String msg) Helper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given type.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 notwrongTokenException(JsonParser jp, JsonToken expToken, String msg) Helper method for indicating that the current token was expected to be another token.Methods inherited from class DeserializationContext
constructType, getBase64Variant, getConfig, getNodeFactory, getTypeFactory, isEnabled, mappingException
-
Field Details
-
_parser
Currently active parser used for deserialization. May be different from the outermost parser when content is buffered. -
_deserProvider
- Since:
- 1.5
-
_injectableValues
- Since:
- 1.9
-
_arrayBuilders
-
_objectBuffer
-
_dateFormat
-
-
Constructor Details
-
StdDeserializationContext
public StdDeserializationContext(DeserializationConfig config, JsonParser jp, DeserializerProvider prov, InjectableValues injectableValues)
-
-
Method Details
-
getDeserializerProvider
Description copied from class:DeserializationContextReturns provider that can be used for dynamically locating other deserializers during runtime.- Overrides:
getDeserializerProviderin classDeserializationContext
-
getParser
Method for accessing the currently active parser. May be different from the outermost parser when content is buffered.Use of this method is discouraged: if code has direct access to the active parser, that should be used instead.
- Specified by:
getParserin classDeserializationContext
-
findInjectableValue
- Specified by:
findInjectableValuein classDeserializationContext
-
leaseObjectBuffer
Description copied from class:DeserializationContextMethod that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists. Note that leased buffers should be returned once deserializer is done, to allow for reuse during same round of deserialization.- Specified by:
leaseObjectBufferin classDeserializationContext
-
returnObjectBuffer
Description copied from class:DeserializationContextMethod to call to return object buffer previously leased withDeserializationContext.leaseObjectBuffer().- Specified by:
returnObjectBufferin classDeserializationContext- Parameters:
buf- Returned object buffer
-
getArrayBuilders
Description copied from class:DeserializationContextMethod for accessing object useful for building arrays of primitive types (such as int[]).- Specified by:
getArrayBuildersin classDeserializationContext
-
parseDate
Description copied from class:DeserializationContextConvenience method for parsing a Date from given String, using currently configured date format (accessed usingMapperConfig.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.
- Specified by:
parseDatein classDeserializationContext- Throws:
IllegalArgumentException
-
constructCalendar
Description copied from class:DeserializationContextConvenience method for constructing Calendar instance set to specified time, to be modified and used by caller.- Specified by:
constructCalendarin classDeserializationContext
-
handleUnknownProperty
public boolean handleUnknownProperty(JsonParser jp, JsonDeserializer<?> deser, Object instanceOrClass, String propName) throws IOException, JsonProcessingException Method deserializers can call to inform configuredDeserializationProblemHandlers of an unrecognized property.- Specified by:
handleUnknownPropertyin classDeserializationContext- Returns:
- True if there was a configured problem handler that was able to handle the proble
- Throws:
IOExceptionJsonProcessingException- Since:
- 1.5
-
mappingException
Description copied from class:DeserializationContextHelper method for constructing generic mapping exception for specified type- Specified by:
mappingExceptionin classDeserializationContext
-
mappingException
- Specified by:
mappingExceptionin classDeserializationContext
-
instantiationException
Description copied from class:DeserializationContextHelper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor)- Specified by:
instantiationExceptionin classDeserializationContext
-
instantiationException
- Specified by:
instantiationExceptionin classDeserializationContext
-
weirdStringException
Method that will construct an exception suitable for throwing when some String values are acceptable, but the one encountered is not- Specified by:
weirdStringExceptionin classDeserializationContext
-
weirdNumberException
Description copied from class:DeserializationContextHelper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given type.- Specified by:
weirdNumberExceptionin classDeserializationContext
-
weirdKeyException
Description copied from class:DeserializationContextHelper method for constructing exception to indicate that given JSON Object field name was not in format to be able to deserialize specified key type.- Specified by:
weirdKeyExceptionin classDeserializationContext
-
wrongTokenException
Description copied from class:DeserializationContextHelper method for indicating that the current token was expected to be another token.- Specified by:
wrongTokenExceptionin classDeserializationContext
-
unknownFieldException
Description copied from class:DeserializationContextHelper method for constructing exception to indicate that JSON Object field name did not map to a known property of type being deserialized.- Specified by:
unknownFieldExceptionin classDeserializationContext- Parameters:
instanceOrClass- Either value being populated (if one has been instantiated), or Class that indicates type that would be (or have been) instantiated
-
unknownTypeException
Description copied from class:DeserializationContextHelper method for constructing exception to indicate that given type id (parsed from JSON) could not be converted to a Java type.- Specified by:
unknownTypeExceptionin classDeserializationContext
-
getDateFormat
-
determineClassName
-
_calcName
-
_valueDesc
-
_desc
-