Top Fields Constructors Methods
com.fasterxml.jackson.datatype.guava.deser

public Class GuavaOptionalDeserializer

extends ReferenceTypeDeserializer<Optional<?>>
Class Inheritance
Imports
com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.ValueInstantiator, com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.google.common.base.Optional

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer:
_fullType_valueDeserializer_valueInstantiator_valueTypeDeserializer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
getEmptyValue(DeserializationContext ctxt)

Overrides com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getEmptyValue.

Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings).

public Optional<?>
getNullValue(DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getNullValue.

Implements com.fasterxml.jackson.databind.deser.NullValueProvider.getNullValue.

Method that can be called to determine value to be used for representing null values (values deserialized when JSON token is JsonToken#VALUE_NULL).

public Object
getReferenced(Optional<?> reference)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

Method that may be called to find contents of specified reference, if any; or `null` if none.

public Optional<?>
public Optional<?>
updateReference(Optional<?> reference, Object contents)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

Method called in case of "merging update", in which we should try update reference instead of creating a new one.

public GuavaOptionalDeserializer
withResolved(TypeDeserializer typeDeser, JsonDeserializer<?> valueDeser)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Mutant factory method called when changes are needed; should construct newly configured instance with new values as indicated.

Inherited from com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer:
createContextualdeserializedeserializedeserializeWithTypegetEmptyAccessPatterngetNullAccessPatterngetValueInstantiatorgetValueTypelogicalTypesupportsUpdate

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.serialVersionUID.

Constructor Detail

GuavaOptionalDeserializerback to summary
public GuavaOptionalDeserializer(JavaType fullType, ValueInstantiator inst, TypeDeserializer typeDeser, JsonDeserializer<?> deser)
Since
2.9

Method Detail

getEmptyValueback to summary
public Object getEmptyValue(DeserializationContext ctxt) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getEmptyValue.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.getEmptyValue.

Method called to determine value to be used for "empty" values (most commonly when deserializing from empty JSON Strings). Usually this is same as getNullValue (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 getEmptyAccessPattern() returns.

Default implementation simply calls getNullValue and returns value.

Annotations
@Override
getNullValueback to summary
public Optional<?> getNullValue(DeserializationContext ctxt) throws JsonMappingException

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getNullValue.

Implements com.fasterxml.jackson.databind.deser.NullValueProvider.getNullValue.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.getNullValue.

Method that can be called to determine value to be used for representing null values (values deserialized when JSON token is JsonToken#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 getNullAccessPattern() returns.

Default implementation simply returns null.

Annotations
@Override
getReferencedback to summary
public Object getReferenced(Optional<?> reference)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

Doc from com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.getReferenced.

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.

Annotations
@Override
referenceValueback to summary
public Optional<?> referenceValue(Object contents)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.referenceValue.

Annotations
@Override
updateReferenceback to summary
public Optional<?> updateReference(Optional<?> reference, Object contents)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

Doc from com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.updateReference.

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.

Annotations
@Override
withResolvedback to summary
public GuavaOptionalDeserializer withResolved(TypeDeserializer typeDeser, JsonDeserializer<?> valueDeser)

Implements abstract com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Doc from com.fasterxml.jackson.databind.deser.std.ReferenceTypeDeserializer.withResolved.

Mutant 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.

Annotations
@Override