Class AtomicReferenceDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer<AtomicReference<Object>>
-
- com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer
-
- All Implemented Interfaces:
ContextualDeserializer,NullValueProvider,Serializable
public class AtomicReferenceDeserializer extends ReferenceTypeDeserializer<AtomicReference<Object>>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
JsonDeserializer.None
-
-
Field Summary
-
Fields inherited from class com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer
_fullType, _valueDeserializer, _valueInstantiator, _valueTypeDeserializer
-
Fields inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_valueClass, _valueType, F_MASK_ACCEPT_ARRAYS, F_MASK_INT_COERCIONS
-
-
Constructor Summary
Constructors Constructor Description AtomicReferenceDeserializer(JavaType fullType, ValueInstantiator inst, TypeDeserializer typeDeser, JsonDeserializer<?> deser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetEmptyValue(DeserializationContext ctxt)Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).AtomicReference<Object>getNullValue(DeserializationContext ctxt)Method that can be called to determine value to be used for representing null values (values deserialized when JSON token isJsonToken.VALUE_NULL).ObjectgetReferenced(AtomicReference<Object> reference)Method that may be called to find contents of specified reference, if any; or `null` if none.AtomicReference<Object>referenceValue(Object contents)BooleansupportsUpdate(DeserializationConfig config)By default we assume that updateability mostly relies on value deserializer; if it supports updates, typically that's what matters.AtomicReference<Object>updateReference(AtomicReference<Object> reference, Object contents)Method called in case of "merging update", in which we should try update reference instead of creating a new one.AtomicReferenceDeserializerwithResolved(TypeDeserializer typeDeser, JsonDeserializer<?> valueDeser)Mutant factory method called when changes are needed; should construct newly configured instance with new values as indicated.-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer
createContextual, deserialize, deserialize, deserializeWithType, getEmptyAccessPattern, getNullAccessPattern, getValueType
-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_byteOverflow, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeWrappedValue, _failDoubleToIntCoercion, _findNullProvider, _hasTextualNull, _intOverflow, _isEmptyOrTextualNull, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _neitherNull, _nonNullNumber, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseIntPrimitive, _parseIntPrimitive, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueType, handledType, handleMissingEndArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer, parseDouble
-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserializeWithType, findBackReference, getDelegatee, getEmptyValue, getKnownPropertyNames, getNullValue, getObjectIdReader, isCachable, replaceDelegatee, unwrappingDeserializer
-
-
-
-
Constructor Detail
-
AtomicReferenceDeserializer
public AtomicReferenceDeserializer(JavaType fullType, ValueInstantiator inst, TypeDeserializer typeDeser, JsonDeserializer<?> deser)
- Since:
- 2.9
-
-
Method Detail
-
withResolved
public AtomicReferenceDeserializer withResolved(TypeDeserializer typeDeser, JsonDeserializer<?> valueDeser)
Description copied from class:ReferenceTypeDeserializerMutant factory method called when changes are needed; should construct newly configured instance with new values as indicated.NOTE: caller has verified that there are changes, so implementations need NOT check if a new instance is needed.
- Specified by:
withResolvedin classReferenceTypeDeserializer<AtomicReference<Object>>
-
getNullValue
public AtomicReference<Object> getNullValue(DeserializationContext ctxt) throws JsonMappingException
Description copied from class:JsonDeserializerMethod that can be called to determine value to be used for representing null values (values deserialized when JSON token isJsonToken.VALUE_NULL). Usually this is simply Java null, but for some types (especially primitives) it may be necessary to use non-null values.This method may be called once, or multiple times, depending on what
JsonDeserializer.getNullAccessPattern()returns.Default implementation simply returns null.
- Specified by:
getNullValuein interfaceNullValueProvider- Specified by:
getNullValuein classReferenceTypeDeserializer<AtomicReference<Object>>- Throws:
JsonMappingException
-
getEmptyValue
public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException
Description copied from class:JsonDeserializerMethod called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings). Usually this is same asJsonDeserializer.getNullValue(com.fasterxml.jackson.databind.DeserializationContext)(which in turn is usually simply Java null), but it can be overridden for specific types. Or, if type should never be converted from empty String, method can also throw an exception.This method may be called once, or multiple times, depending on what
JsonDeserializer.getEmptyAccessPattern()returns.Default implementation simply calls
JsonDeserializer.getNullValue(com.fasterxml.jackson.databind.DeserializationContext)and returns value.- Overrides:
getEmptyValuein classReferenceTypeDeserializer<AtomicReference<Object>>- Throws:
JsonMappingException
-
referenceValue
public AtomicReference<Object> referenceValue(Object contents)
- Specified by:
referenceValuein classReferenceTypeDeserializer<AtomicReference<Object>>
-
getReferenced
public Object getReferenced(AtomicReference<Object> reference)
Description copied from class:ReferenceTypeDeserializerMethod that may be called to find contents of specified reference, if any; or `null` if none. Note that method should never fail, so for types that use concept of "absence" vs "presence", `null` is to be returned for both "absent" and "reference to `null`" cases.- Specified by:
getReferencedin classReferenceTypeDeserializer<AtomicReference<Object>>
-
updateReference
public AtomicReference<Object> updateReference(AtomicReference<Object> reference, Object contents)
Description copied from class:ReferenceTypeDeserializerMethod called in case of "merging update", in which we should try update reference instead of creating a new one. If this does not succeed, should just create a new instance.- Specified by:
updateReferencein classReferenceTypeDeserializer<AtomicReference<Object>>
-
supportsUpdate
public Boolean supportsUpdate(DeserializationConfig config)
Description copied from class:ReferenceTypeDeserializerBy default we assume that updateability mostly relies on value deserializer; if it supports updates, typically that's what matters. So let's just delegate.- Overrides:
supportsUpdatein classReferenceTypeDeserializer<AtomicReference<Object>>
-
-