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<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
-
- com.fasterxml.jackson.databind.deser.std.AtomicReferenceDeserializer
-
- All Implemented Interfaces:
ContextualDeserializer
,NullValueProvider
,ValueInstantiator.Gettable
,java.io.Serializable
public class AtomicReferenceDeserializer extends ReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
JsonDeserializer.None
-
-
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 java.lang.Object
getAbsentValue(DeserializationContext ctxt)
Let's actually NOT coerce missing Creator parameters into empty value.java.lang.Object
getEmptyValue(DeserializationContext ctxt)
Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).java.util.concurrent.atomic.AtomicReference<java.lang.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
).java.lang.Object
getReferenced(java.util.concurrent.atomic.AtomicReference<java.lang.Object> reference)
Method that may be called to find contents of specified reference, if any; or `null` if none.java.util.concurrent.atomic.AtomicReference<java.lang.Object>
referenceValue(java.lang.Object contents)
java.lang.Boolean
supportsUpdate(DeserializationConfig config)
By default we assume that updateability mostly relies on value deserializer; if it supports updates, typically that's what matters.java.util.concurrent.atomic.AtomicReference<java.lang.Object>
updateReference(java.util.concurrent.atomic.AtomicReference<java.lang.Object> reference, java.lang.Object contents)
Method called in case of "merging update", in which we should try update reference instead of creating a new one.AtomicReferenceDeserializer
withResolved(TypeDeserializer typeDeser, JsonDeserializer<?> valueDeser)
-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer
createContextual, deserialize, deserialize, deserializeWithType, getEmptyAccessPattern, getNullAccessPattern, getValueInstantiator, getValueType, logicalType
-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
getValueClass, getValueType, handledType
-
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)
-
getNullValue
public java.util.concurrent.atomic.AtomicReference<java.lang.Object> getNullValue(DeserializationContext ctxt) throws JsonMappingException
Description copied from class:JsonDeserializer
Method 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:
getNullValue
in interfaceNullValueProvider
- Specified by:
getNullValue
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
- Throws:
JsonMappingException
-
getEmptyValue
public java.lang.Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException
Description copied from class:JsonDeserializer
Method 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:
getEmptyValue
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
- Throws:
JsonMappingException
-
getAbsentValue
public java.lang.Object getAbsentValue(DeserializationContext ctxt) throws JsonMappingException
Let's actually NOT coerce missing Creator parameters into empty value.- Specified by:
getAbsentValue
in interfaceNullValueProvider
- Overrides:
getAbsentValue
in classJsonDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
- Throws:
JsonMappingException
-
referenceValue
public java.util.concurrent.atomic.AtomicReference<java.lang.Object> referenceValue(java.lang.Object contents)
- Specified by:
referenceValue
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
-
getReferenced
public java.lang.Object getReferenced(java.util.concurrent.atomic.AtomicReference<java.lang.Object> reference)
Description copied from class:ReferenceTypeDeserializer
Method 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:
getReferenced
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
-
updateReference
public java.util.concurrent.atomic.AtomicReference<java.lang.Object> updateReference(java.util.concurrent.atomic.AtomicReference<java.lang.Object> reference, java.lang.Object contents)
Description copied from class:ReferenceTypeDeserializer
Method 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:
updateReference
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
-
supportsUpdate
public java.lang.Boolean supportsUpdate(DeserializationConfig config)
Description copied from class:ReferenceTypeDeserializer
By 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:
supportsUpdate
in classReferenceTypeDeserializer<java.util.concurrent.atomic.AtomicReference<java.lang.Object>>
-
-