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

pack-priv abstract Class GuavaImmutableCollectionDeserializer<T extends ImmutableCollection<Object>>

extends GuavaCollectionDeserializer<T extends ImmutableCollection<Object>>
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.datatype.guava.deser.ImmutableListDeserializer, com.fasterxml.jackson.datatype.guava.deser.ImmutableMultisetDeserializer, com.fasterxml.jackson.datatype.guava.deser.ImmutableSetDeserializer, com.fasterxml.jackson.datatype.guava.deser.ImmutableSortedMultisetDeserializer, com.fasterxml.jackson.datatype.guava.deser.ImmutableSortedSetDeserializer
Imports
java.io.IOException, com.fasterxml.jackson.core.JsonParser, .JsonToken, com.fasterxml.jackson.databind.DeserializationConfig, .DeserializationContext, .JavaType, .JsonDeserializer, com.fasterxml.jackson.databind.deser.NullValueProvider, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.util.AccessPattern, .ClassUtil, com.google.common.collect.ImmutableCollection

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer:
_valueDeserializer_valueTypeDeserializer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected T
protected Object
protected void
_tryToAddNull(JsonParser p, DeserializationContext ctxt, ImmutableCollection.Builder<Object> builder)

Some/many Guava containers do not allow addition of null values, so isolate handling here.

protected abstract ImmutableCollection.Builder<Object>
public AccessPattern
getEmptyAccessPattern()

Implements abstract com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.getEmptyAccessPattern.

This method may be called in conjunction with calls to getEmptyValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.

public T
getEmptyValue(DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.getEmptyValue.

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

public Boolean
supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase.supportsUpdate.

Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not.

Inherited from com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer:
_createEmpty_createWithSingleElement_deserializeFromSingleValue_tryToAddNullcreateContextualdeserializedeserializeWithTypegetContentDeserializerlogicalTypewithResolved

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.serialVersionUID.

Constructor Detail

GuavaImmutableCollectionDeserializerback to summary
pack-priv GuavaImmutableCollectionDeserializer(JavaType selfType, JsonDeserializer<?> deser, TypeDeserializer typeDeser, NullValueProvider nuller, Boolean unwrapSingle)

Method Detail

_deserializeContentsback to summary
protected T _deserializeContents(JsonParser p, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer._deserializeContents.

Annotations
@Override
_resolveNullToValueback to summary
protected Object _resolveNullToValue(DeserializationContext ctxt) throws IOException
Since
2.10
_tryToAddNullback to summary
protected void _tryToAddNull(JsonParser p, DeserializationContext ctxt, ImmutableCollection.Builder<Object> builder) throws IOException

Some/many Guava containers do not allow addition of null values, so isolate handling here.

Since
2.17
createBuilderback to summary
protected abstract ImmutableCollection.Builder<Object> createBuilder()
getEmptyAccessPatternback to summary
public AccessPattern getEmptyAccessPattern()

Implements abstract com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.getEmptyAccessPattern.

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

This method may be called in conjunction with calls to getEmptyValue(DeserializationContext), to check whether it needs to be called just once (static values), or each time empty value is needed.

Annotations
@Override
getEmptyValueback to summary
public T getEmptyValue(DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.datatype.guava.deser.GuavaCollectionDeserializer.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
supportsUpdateback to summary
public Boolean supportsUpdate(DeserializationConfig config)

Overrides com.fasterxml.jackson.databind.deser.std.ContainerDeserializerBase.supportsUpdate.

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

Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. Return value should either be Boolean#FALSE if update is not supported at all (immutable values); Boolean#TRUE if update should usually work (regular POJOs, for example), or null if this is either not known, or may sometimes work.

Information gathered is typically used to either prevent merging update for property (either by skipping, if based on global defaults; or by exception during deserializer construction if explicit attempt made) if Boolean#FALSE returned, or inclusion if Boolean#TRUE is specified. If "unknown" case (null returned) behavior is to exclude property if global defaults used; or to allow if explicit per-type or property merging is defined.

Default implementation returns null to allow explicit per-type or per-property attempts.

Annotations
@Override