Class XmlDeserializationContext
- java.lang.Object
-
- com.fasterxml.jackson.databind.DatabindContext
-
- com.fasterxml.jackson.databind.DeserializationContext
-
- com.fasterxml.jackson.databind.deser.DefaultDeserializationContext
-
- com.fasterxml.jackson.dataformat.xml.deser.XmlDeserializationContext
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlDeserializationContext extends DefaultDeserializationContext
XML-specificDeserializationContext
needed to override certain handlers.- Since:
- 2.12
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.deser.DefaultDeserializationContext
DefaultDeserializationContext.Impl
-
-
Constructor Summary
Constructors Constructor Description XmlDeserializationContext(DeserializerFactory df)
Default constructor for a blueprint object, which will use the standardDeserializerCache
, given factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XmlDeserializationContext
copy()
Method needed to ensure thatObjectMapper.copy()
will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.DefaultDeserializationContext
createDummyInstance(DeserializationConfig config)
DefaultDeserializationContext
createInstance(DeserializationConfig config, JsonParser p, InjectableValues values)
Method called to create actual usable per-deserialization context instance.java.lang.String
extractScalarFromObject(JsonParser p, JsonDeserializer<?> deser, java.lang.Class<?> scalarType)
Method to call in case incoming shape is Object Value (and parser thereby points toJsonToken.START_OBJECT
token), but a Scalar value (potentially coercible from String value) is expected.java.lang.Object
readRootValue(JsonParser p, JavaType valueType, JsonDeserializer<java.lang.Object> deser, java.lang.Object valueToUpdate)
DefaultDeserializationContext
with(DeserializerFactory factory)
Fluent factory method used for constructing a blueprint instance with different factoryDefaultDeserializationContext
withCaches(CacheProvider cp)
Fluent factory method used for constructing a new instance with cache instances provided byCacheProvider
.-
Methods inherited from class com.fasterxml.jackson.databind.deser.DefaultDeserializationContext
checkUnresolvedObjectId, deserializerInstance, findObjectId, keyDeserializerInstance
-
Methods inherited from class com.fasterxml.jackson.databind.DeserializationContext
bufferAsCopyOfValue, bufferForInputBuffering, bufferForInputBuffering, canOverrideAccessModifiers, constructCalendar, constructSpecializedType, constructType, findClass, findCoercionAction, findCoercionFromBlankString, findContextualValueDeserializer, findInjectableValue, findKeyDeserializer, findNonContextualValueDeserializer, findRootValueDeserializer, getActiveView, getAnnotationIntrospector, getArrayBuilders, getAttribute, getBase64Variant, getConfig, getContextualType, getDatatypeFeatures, getDefaultPropertyFormat, getDeserializationFeatures, getFactory, getLocale, getNodeFactory, getParser, getTimeZone, getTypeFactory, handleBadMerge, handleInstantiationProblem, handleMissingInstantiator, handleMissingTypeId, handlePrimaryContextualization, handleSecondaryContextualization, handleUnexpectedToken, handleUnexpectedToken, handleUnexpectedToken, handleUnexpectedToken, handleUnknownProperty, handleUnknownTypeId, handleWeirdKey, handleWeirdNativeValue, handleWeirdNumberValue, handleWeirdStringValue, hasDeserializationFeatures, hasSomeOfFeatures, hasValueDeserializerFor, instantiationException, instantiationException, invalidTypeIdException, isEnabled, isEnabled, isEnabled, isEnabled, leaseObjectBuffer, missingTypeIdException, parseDate, readPropertyValue, readPropertyValue, readTree, readTreeAsValue, readTreeAsValue, readValue, readValue, reportBadCoercion, reportBadDefinition, reportBadPropertyDefinition, reportBadTypeDefinition, reportInputMismatch, reportInputMismatch, reportInputMismatch, reportInputMismatch, reportPropertyInputMismatch, reportPropertyInputMismatch, reportTrailingTokens, reportUnresolvedObjectId, reportWrongTokenException, reportWrongTokenException, reportWrongTokenException, returnObjectBuffer, setAttribute, weirdKeyException, weirdNativeValueException, weirdNumberException, weirdStringException, wrongTokenException, wrongTokenException
-
Methods inherited from class com.fasterxml.jackson.databind.DatabindContext
constructType, converterInstance, objectIdGeneratorInstance, objectIdResolverInstance, reportBadDefinition, resolveAndValidateSubType, resolveSubType
-
-
-
-
Constructor Detail
-
XmlDeserializationContext
public XmlDeserializationContext(DeserializerFactory df)
Default constructor for a blueprint object, which will use the standardDeserializerCache
, given factory.
-
-
Method Detail
-
copy
public XmlDeserializationContext copy()
Description copied from class:DefaultDeserializationContext
Method needed to ensure thatObjectMapper.copy()
will work properly; specifically, that caches are cleared, but settings will otherwise remain identical; and that no sharing of state occurs.- Overrides:
copy
in classDefaultDeserializationContext
-
createInstance
public DefaultDeserializationContext createInstance(DeserializationConfig config, JsonParser p, InjectableValues values)
Description copied from class:DefaultDeserializationContext
Method called to create actual usable per-deserialization context instance.- Specified by:
createInstance
in classDefaultDeserializationContext
-
createDummyInstance
public DefaultDeserializationContext createDummyInstance(DeserializationConfig config)
- Specified by:
createDummyInstance
in classDefaultDeserializationContext
-
with
public DefaultDeserializationContext with(DeserializerFactory factory)
Description copied from class:DefaultDeserializationContext
Fluent factory method used for constructing a blueprint instance with different factory- Specified by:
with
in classDefaultDeserializationContext
-
withCaches
public DefaultDeserializationContext withCaches(CacheProvider cp)
Description copied from class:DefaultDeserializationContext
Fluent factory method used for constructing a new instance with cache instances provided byCacheProvider
.- Specified by:
withCaches
in classDefaultDeserializationContext
-
readRootValue
public java.lang.Object readRootValue(JsonParser p, JavaType valueType, JsonDeserializer<java.lang.Object> deser, java.lang.Object valueToUpdate) throws java.io.IOException
- Overrides:
readRootValue
in classDefaultDeserializationContext
- Throws:
java.io.IOException
-
extractScalarFromObject
public java.lang.String extractScalarFromObject(JsonParser p, JsonDeserializer<?> deser, java.lang.Class<?> scalarType) throws java.io.IOException
Description copied from class:DeserializationContext
Method to call in case incoming shape is Object Value (and parser thereby points toJsonToken.START_OBJECT
token), but a Scalar value (potentially coercible from String value) is expected. This would typically be used to deserializer a Number, Boolean value or some other "simple" unstructured value type.- Overrides:
extractScalarFromObject
in classDeserializationContext
- Parameters:
p
- Actual parser to read content fromdeser
- Deserializer that needs extracted String valuescalarType
- Immediate type of scalar to extract; usually type deserializer handles but not always (for example, deserializer forint[]
would pass scalar type ofint
)- Returns:
- String value found; not
null
(exception should be thrown if no suitable value found) - Throws:
java.io.IOException
- If there are problems either reading content (underlying parser problem) or finding expected scalar value
-
-