Instance life-cycle is such that a partially configured "blueprint" object
is registered with ObjectMapper (and ObjectReader,
and when actual instance is needed for deserialization,
a fully configured instance will be created using a method in extended internal
API of sub-class
(com.).
Each instance is guaranteed to only be used from single-threaded context;
instances may be reused if (and only if) no configuration has changed.
Defined as abstract class so that implementations must define methods for reconfiguring blueprints and creating instances.
| Modifier and Type | Field and Description |
|---|---|
| protected transient ArrayBuilders | |
| protected transient ContextAttributes | _attributes
Lazily-constructed holder for per-call attributes. |
| protected final DeserializerCache | _cache
Object that handle details of |
| protected final DeserializationConfig | _config
Generic deserialization processing configuration |
| protected LinkedNode | _currentType
Type of |
| protected transient DateFormat | |
| protected final DeserializerFactory | _factory
Read-only factory instance; exposed to let
owners ( |
| protected final int | _featureFlags
Bitmap of |
| protected final InjectableValues | _injectableValues
Object used for resolving references to injectable values. |
| protected transient ObjectBuffer | |
| protected transient JsonParser | _parser
Currently active parser used for deserialization. |
| protected final JacksonFeatureSet | _readCapabilities
Capabilities of the input format. |
| protected final Class | _view
Currently active view, if any. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected | DeserializationContext(DeserializationContext src, DeserializationConfig config, JsonParser p, InjectableValues injectableValues)
Constructor used for creating actual per-call instances. |
| protected | DeserializationContext(DeserializationContext src, DeserializationConfig config)
Constructor used for creating bogus per-call style instance, but without underlying parser: needed for deserializer pre-fetching |
| protected | DeserializationContext(DeserializationContext src)
Copy-constructor for use with |
| Modifier and Type | Method and Description |
|---|---|
| protected DateFormat | |
| protected boolean | |
| protected String | _shapeForToken(JsonToken t)
Helper method for constructing description like "Object value" given
|
| private TreeTraversingParser | |
| public TokenBuffer | bufferAsCopyOfValue(JsonParser p)
Convenience method, equivalent to: TokenBuffer buffer = ctxt.bufferForInputBuffering(parser); buffer.copyCurrentStructure(parser); return buffer; |
| public TokenBuffer | bufferForInputBuffering(JsonParser p)
Factory method used for creating |
| public final TokenBuffer | bufferForInputBuffering()
Convenience method that is equivalent to: ctxt.bufferForInputBuffering(ctxt.getParser()); |
| public final boolean | canOverrideAccessModifiers()
Implements abstract com. Convenience method for accessing serialization view in use (if any); equivalent to: getConfig().canOverrideAccessModifiers(); |
| public abstract void | checkUnresolvedObjectId()
Method called to ensure that every object id encounter during processing are resolved. |
| public Calendar | constructCalendar(Date d)
Convenience method for constructing Calendar instance set to specified time, to be modified and used by caller. |
| public JavaType | constructSpecializedType(JavaType baseType, Class<?> subclass)
Implements abstract com. Convenience method for constructing subtypes, retaining generic type parameter (if any). |
| public final JavaType | constructType(Class<?> cls)
Convenience method, functionally equivalent to: getConfig().constructType(cls); |
| public abstract JsonDeserializer | |
| public String | Returns: String value found; notnull (exception should be thrown if no suitable
value found)Actual parser to read content from p, JsonDeserializer<?> Deserializer that needs extracted String value deser, Class<?> Immediate type of scalar to extract; usually type deserializer
handles but not always (for example, deserializer for scalarType)int[] would pass
scalar type of int)Method to call in case incoming shape is Object Value (and parser thereby
points to |
| public Class | |
| public CoercionAction | Returns: CoercionAction configured for specific coercionLogical target type of coercion targetType, Class<?> Physical target type of coercion targetClass, CoercionInputShape Input shape to coerce from inputShape)General-purpose accessor for finding what to do when specified coercion from shape that is now always allowed to be coerced from is requested. |
| public CoercionAction | Returns: CoercionAction configured for specified coercion from blank stringLogical target type of coercion targetType, Class<?> Physical target type of coercion targetClass, CoercionAction Return value to use in case "blanks as empty"
is not allowed actionIfBlankNotAllowed)More specialized accessor called in case of input being a blank String (one consisting of only white space characters with length of at least one). |
| public final JsonDeserializer | findContextualValueDeserializer(JavaType type, BeanProperty prop)
Method for finding a value deserializer, and creating a contextual version if necessary, for value reached via specified property. |
| public final Object | |
| public final KeyDeserializer | findKeyDeserializer(JavaType keyType, BeanProperty prop)
Convenience method, functionally same as: getDeserializerProvider().findKeyDeserializer(getConfig(), prop.getType(), prop); |
| public final JsonDeserializer | findNonContextualValueDeserializer(JavaType type)
Variant that will try to locate deserializer for current type, but without
performing any contextualization (unlike |
| public abstract ReadableObjectId | findObjectId(Object id, ObjectIdGenerator<?> generator, ObjectIdResolver resolver)
Method called to find and return entry corresponding to given Object Id: will add an entry if necessary, and never returns null |
| public final JsonDeserializer | |
| public final Class | getActiveView()
Implements abstract com. Accessor for locating currently active view, if any; returns null if no view has been set. |
| public final AnnotationIntrospector | getAnnotationIntrospector()
Implements abstract com. Convenience method for accessing serialization view in use (if any); equivalent to: getConfig().getAnnotationIntrospector(); |
| public final ArrayBuilders | getArrayBuilders()
Method for accessing object useful for building arrays of primitive types (such as int[]). |
| public Object | getAttribute(Object
Key of the attribute to get key)Implements abstract com. Method for accessing attributes available in this context. |
| public final Base64Variant | getBase64Variant()
Convenience method for accessing the default Base64 encoding used for decoding base64 encoded binary content. |
| public DeserializationConfig | getConfig()
Implements abstract com. Accessor to currently active configuration (both per-request configs and per-mapper config). |
| public JavaType | Returns: Type ofContextualDeserializer being contextualized,
if process is on-going; null if not.Accessor to |
| public final DatatypeFeatures | getDatatypeFeatures()
Implements abstract com.
|
| public final JsonFormat. | getDefaultPropertyFormat(Class<?> baseType)
Implements abstract com.
|
| public final int | getDeserializationFeatures()
Bulk access method for getting the bit mask of all |
| public DeserializerFactory | |
| public Locale | getLocale()
Implements abstract com. Method for accessing default Locale to use: convenience method for getConfig().getLocale(); |
| public final JsonNodeFactory | |
| public final JsonParser | |
| public TimeZone | getTimeZone()
Implements abstract com. Method for accessing default TimeZone to use: convenience method for getConfig().getTimeZone(); |
| public final TypeFactory | |
| public void | handleBadMerge(JsonDeserializer<?> deser)
Method that deserializer may call if it is called to do an update ("merge") but deserializer operates on a non-mergeable type. |
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated instClass, Object (optional) Argument that was passed to constructor or equivalent
instantiator; often a argument, Throwable java..Exception that caused failure t)Method that deserializers should call if they fail to instantiate value due to an exception that was thrown by constructor (or other mechanism used to create instances). |
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated instClass, ValueInstantiator (optional) Value instantiator to be used, if any; null if type does not
use one for instantiation (custom deserialiers don't; standard POJO deserializer does) valueInst, JsonParser Parser that points to the JSON value to decode p, String msg, Object... msgArgs)Method that deserializers should call if they fail to instantiate value due to lack of viable instantiator (usually creator, that is, constructor or static factory method). |
| public JavaType | |
| public JsonDeserializer | handlePrimaryContextualization(JsonDeserializer<?> deser, BeanProperty
Property for which the given primary deserializer is used; never null. prop, JavaType type)Method called for primary property deserializers (ones
directly created to deserialize values of a POJO property),
to handle details of resolving
|
| public JsonDeserializer | handleSecondaryContextualization(JsonDeserializer<?> deser, BeanProperty
Property for which deserializer is used, if any; null
when deserializing root values prop, JavaType type)Method called for secondary property deserializers (ones
NOT directly created to deal with an annotatable POJO property,
but instead created as a component -- such as value deserializers
for structured types, or deserializers for root values)
to handle details of resolving
|
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated instClass, JsonParser Parser that points to the JSON value to decode p)Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). |
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated instClass, JsonToken Token encountered that does match expected t, JsonParser Parser that points to the JSON value to decode p, String msg, Object... msgArgs)Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). |
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated targetType, JsonParser Parser that points to the JSON value to decode p)Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). |
| public Object | Returns: Object that should be constructed, if any; has to be of typeinstClassType that was to be instantiated targetType, JsonToken Token encountered that does not match expected t, JsonParser Parser that points to the JSON value to decode p, String msg, Object... msgArgs)Method that deserializers should call if the first token of the value to deserialize is of unexpected type (that is, type of token that deserializer cannot handle). |
| public boolean | Returns: True if there was a configured problem handler that was able to handle the problemMethod that deserializers should call if they encounter an unrecognized
property (and once that is not explicitly designed as ignorable), to
inform possibly configured |
| public JavaType | Returns: JavaType that id resolves toBase type from which resolution starts baseType, String Type id that could not be converted id, TypeIdResolver idResolver, String Additional problem description to add to default exception message,
if resolution fails. extraDesc)Method that deserializers should call if they encounter a type id (for polymorphic deserialization) that cannot be resolved to an actual type; usually since there is no mapping defined. |
| public Object | Returns: Key value to useExpected type for key keyClass, String String value from which to deserialize key keyValue, String Error message template caller wants to use if exception is to be thrown msg, Object... Optional arguments to use for message, if any msgArgs)Method that deserializers should call if they encounter a String value
that cannot be converted to expected key of a |
| public Object | |
| public Object | Returns: Property value to useType of property into which incoming number should be converted targetClass, Number Number value from which to deserialize property value value, String Error message template caller wants to use if exception is to be thrown msg, Object... Optional arguments to use for message, if any msgArgs)Method that deserializers should call if they encounter a numeric value that cannot be converted to target property type, in cases where some numeric values could be acceptable (either with different settings, or different numeric value). |
| public Object | Returns: Property value to useType of property into which incoming number should be converted targetClass, String String value from which to deserialize property value value, String Error message template caller wants to use if exception is to be thrown msg, Object... Optional arguments to use for message, if any msgArgs)Method that deserializers should call if they encounter a String value that cannot be converted to target property type, in cases where some String values could be acceptable (either with different settings, or different value). |
| public final boolean | hasDeserializationFeatures(int featureMask)
Bulk access method for checking that all features specified by mask are enabled. |
| public final boolean | hasSomeOfFeatures(int featureMask)
Bulk access method for checking that at least one of features specified by mask is enabled. |
| public boolean | hasValueDeserializerFor(JavaType
Type to check type, AtomicReference<Throwable> (optional) Reference set to root cause if no deserializer
could be found due to exception (to find the reason for failure) cause)Method for checking whether we could find a deserializer for given type. |
| public JsonMappingException | instantiationException(Class<?> instClass, Throwable cause)
Helper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor)
Note that most of the time this method should NOT be called directly; instead,
|
| public JsonMappingException | instantiationException(Class<?> instClass, String msg0)
Helper method for constructing instantiation exception for specified type, to indicate that instantiation failed due to missing instantiator (creator; constructor or factory method). |
| public JsonMappingException | invalidTypeIdException(JavaType baseType, String typeId, String extraDesc)
Implements abstract com. Helper method for constructing exception to indicate that given type id could not be resolved to a valid subtype of specified base type. |
| public final boolean | isEnabled(MapperFeature feature)
Implements abstract com. Convenience method for checking whether specified Mapper feature is enabled or not. |
| public final boolean | isEnabled(DatatypeFeature feature)
Implements abstract com. Method for checking whether specified datatype feature is enabled or not. |
| public final boolean | isEnabled(DeserializationFeature feat)
Convenience method for checking whether specified on/off feature is enabled |
| public final boolean | Returns: True if input format has specified capability; false if notAccessor for checking whether input format has specified capability or not. |
| public abstract KeyDeserializer | |
| public final ObjectBuffer | leaseObjectBuffer()
Method that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists. |
| public JsonMappingException | |
| public Date | parseDate(String dateStr)
Convenience method for parsing a Date from given String, using
currently configured date format (accessed using
|
| public <T> T | Returns: Value of typetype that was readParser that points to the first token of the value to read p, BeanProperty Logical property of a POJO being type prop, Class<T> type)Convenience method that may be used by composite or container deserializers, for reading one-off values for the composite type, taking into account annotations that the property (passed to this method -- usually property that has custom serializer that called this method) has. |
| public <T> T | readPropertyValue(JsonParser p, BeanProperty prop, JavaType type)
Same as |
| public JsonNode | Returns: Value read asJsonNodeParser that points to the first token of the value to read p)Convenience method for reading the value that passed |
| public <T> T | Returns: Eithernull (if n was null or a value of
type type that was read from non-null n argumentTree value to convert, if not n, Class<T> null: if null, will simply
return nullType to deserialize contents of targetType)n into (if n not null)Helper method similar to |
| public <T> T | Returns: Value of typetype that was readTree value to convert n, JavaType Type to deserialize contents of targetType)n intoSame as Note deserializer implementations should be careful not to try to recursively deserialize into target type deserializer has registered itself to handle. |
| public <T> T | readValue(JsonParser p, Class<T> type)
Convenience method that may be used by composite or container deserializers, for reading one-off values contained (for sequences, it is more efficient to actually fetch deserializer once for the whole collection). |
| public <T> T | |
| public <T> T | reportBadCoercion(JsonDeserializer<?> src, Class<?> targetType, Object inputValue, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where specific input coercion was not allowed. |
| public <T> T | reportBadDefinition(JavaType type, String msg)
Implements abstract com. Helper method called to indicate a generic problem that stems from type
definition(s), not input data, or input/output state; typically this
means throwing a |
| public <T> T | reportBadPropertyDefinition(BeanDescription bean, BeanPropertyDefinition prop, String msg, Object... msgArgs)
Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific property (of a type), unrelated to actual JSON content to map. |
| public <T> T | reportBadTypeDefinition(BeanDescription bean, String msg, Object... msgArgs)
Implements abstract com. Helper method called to indicate problem in POJO (serialization) definitions or settings regarding specific Java type, unrelated to actual JSON content to map. |
| public <T> T | reportInputMismatch(JsonDeserializer<?> src, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | reportInputMismatch(Class<?> targetType, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | reportInputMismatch(JavaType targetType, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | reportInputMismatch(BeanProperty prop, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | reportPropertyInputMismatch(Class<?> targetType, String propertyName, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | reportPropertyInputMismatch(JavaType targetType, String propertyName, String msg, Object... msgArgs)
Helper method used to indicate a problem with input in cases where more
specific |
| public <T> T | |
| public <T> T | |
| public void | reportWrongTokenException(JsonDeserializer<?> deser, JsonToken expToken, String msg, Object... msgArgs)
Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. |
| public void | reportWrongTokenException(JavaType targetType, JsonToken expToken, String msg, Object... msgArgs)
Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. |
| public void | reportWrongTokenException(Class<?> targetType, JsonToken expToken, String msg, Object... msgArgs)
Method for deserializers to call when the token encountered was of type different than what should be seen at that position, usually within a sequence of expected tokens. |
| public final void | returnObjectBuffer(ObjectBuffer
Returned object buffer buf)Method to call to return object buffer previously leased with
|
| public DeserializationContext | setAttribute(Object
Key of the attribute to set key, Object Value to set attribute to value)Implements abstract com. Method for setting per-call value of given attribute. |
| public 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. |
| public JsonMappingException | weirdNativeValueException(Object value, Class<?> instClass)
Helper method for constructing exception to indicate that input JSON
token of type "native value" (see |
| public JsonMappingException | weirdNumberException(Number value, Class<?> instClass, String msg)
Helper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given target type. |
| public JsonMappingException | weirdStringException(String
String value from input being deserialized value, Class<?> Type that String should be deserialized into instClass, String Message that describes specific problem msgBase)Helper method for constructing exception to indicate that input JSON String was not suitable for deserializing into given target type. |
| public JsonMappingException | wrongTokenException(JsonParser p, JavaType targetType, JsonToken expToken, String extra)
Helper method for constructing |
| public JsonMappingException |