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

public Class GuavaDeserializers

extends Base
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, com.google.common.base.Optional, com.google.common.cache.Cache, com.google.common.collect.*, com.google.common.hash.HashCode, com.google.common.net.HostAndPort, .InternetDomainName, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.Deserializers, com.fasterxml.jackson.databind.jsontype.TypeDeserializer, com.fasterxml.jackson.databind.type.CollectionType, .MapLikeType, .MapType, .ReferenceType, com.fasterxml.jackson.datatype.guava.deser.*, com.fasterxml.jackson.datatype.guava.deser.multimap.list.ArrayListMultimapDeserializer, .LinkedListMultimapDeserializer, com.fasterxml.jackson.datatype.guava.deser.multimap.set.HashMultimapDeserializer, .LinkedHashMultimapDeserializer

Custom deserializers module offers.

Field Summary

Modifier and TypeField and Description
protected BoundType
pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
public
GuavaDeserializers(BoundType defaultBoundType)

Method Summary

Modifier and TypeMethod and Description
public JsonDeserializer<?>
findBeanDeserializer(final JavaType
Bean type to deserialize
type
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers
beanDesc
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findBeanDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)

private Optional<JsonDeserializer<?>>

Returns:

An optional JsonDeserializer for the cache type, if found.
findCacheDeserializer
(Class<?> raw, MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)

Find matching implementation of Cache deserializers by checking if the parameter raw type is assignable.

public JsonDeserializer<?>
findCollectionDeserializer(CollectionType
Type of collection instances to deserialize
type
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers
beanDesc
,
TypeDeserializer
If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
elementTypeDeserializer
,
JsonDeserializer<?>
Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
elementDeserializer
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findCollectionDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

We have plenty of collection types to support...

public JsonDeserializer<?>
findMapDeserializer(MapType
Type of java.util.Map instances to deserialize
type
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers
beanDesc
,
KeyDeserializer
Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.
keyDeserializer
,
TypeDeserializer
If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
valueTypeDeserializer
,
JsonDeserializer<?>
Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
valueDeserializer
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findMapDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

A few Map types to support.

public JsonDeserializer<?>
findMapLikeDeserializer(MapLikeType
Type of java.util.Map instances to deserialize
type
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers
beanDesc
,
KeyDeserializer
Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.
keyDeserializer
,
TypeDeserializer
If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.
elementTypeDeserializer
,
JsonDeserializer<?>
Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)
elementDeserializer
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findMapLikeDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findMapLikeDeserializer.

Method called to locate serializer for specified "Map-like" type (one that acts like java.util.Map but does not implement it).

public JsonDeserializer<?>
findReferenceDeserializer(ReferenceType
Specific referential type to deserialize
refType
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the reference type that contains class annotations and other information typically needed for building deserializers
beanDesc
,
TypeDeserializer
Possible type deserializer for referenced value
contentTypeDeserializer
,
JsonDeserializer<?>
Value deserializer to use for referenced value, if indicated by property annotation
contentDeserializer
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findReferenceDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findReferenceDeserializer.

Method called to locate deserializer for value that is of referential type,

public boolean
hasDeserializerFor(DeserializationConfig config, Class<?> valueType)

Overrides default com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer.

private void
Inherited from com.fasterxml.jackson.databind.deser.Deserializers.Base:
findArrayDeserializerfindCollectionLikeDeserializerfindEnumDeserializerfindTreeNodeDeserializer

Field Detail

_defaultBoundTypeback to summary
protected BoundType _defaultBoundType
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Constructor Detail

GuavaDeserializersback to summary
public GuavaDeserializers()
GuavaDeserializersback to summary
public GuavaDeserializers(BoundType defaultBoundType)

Method Detail

findBeanDeserializerback to summary
public JsonDeserializer<?> findBeanDeserializer(final JavaType type, DeserializationConfig config, BeanDescription beanDesc)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findBeanDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)

Parameters
type:JavaType

Bean type to deserialize

config:DeserializationConfig

Configuration in effect

beanDesc:BeanDescription

Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers

Returns:JsonDeserializer<?>

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
findCacheDeserializerback to summary
private Optional<JsonDeserializer<?>> findCacheDeserializer(Class<?> raw, MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer)

Find matching implementation of Cache deserializers by checking if the parameter raw type is assignable.

Note

Make sure the cache implementations are checked in such a way that more concrete classes are compared first before more abstract ones.

Returns:Optional<JsonDeserializer<?>>

An optional JsonDeserializer for the cache type, if found.

Since
2.16
findCollectionDeserializerback to summary
public JsonDeserializer<?> findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findCollectionDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

We have plenty of collection types to support...

Parameters
type:CollectionType

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

Type of collection instances to deserialize

config:DeserializationConfig

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

Configuration in effect

beanDesc:BeanDescription

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers

elementTypeDeserializer:TypeDeserializer

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.

elementDeserializer:JsonDeserializer<?>

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)

Returns:JsonDeserializer<?>

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findCollectionDeserializer.

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
findMapDeserializerback to summary
public JsonDeserializer<?> findMapDeserializer(MapType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer valueTypeDeserializer, JsonDeserializer<?> valueDeserializer) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findMapDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

A few Map types to support.

Parameters
type:MapType

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Type of java.util.Map instances to deserialize

config:DeserializationConfig

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Configuration in effect

beanDesc:BeanDescription

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers

keyDeserializer:KeyDeserializer

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.

valueTypeDeserializer:TypeDeserializer

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.

valueDeserializer:JsonDeserializer<?>

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)

Returns:JsonDeserializer<?>

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapDeserializer.

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
findMapLikeDeserializerback to summary
public JsonDeserializer<?> findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer<?> elementDeserializer) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findMapLikeDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findMapLikeDeserializer.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findMapLikeDeserializer.

Method called to locate serializer for specified "Map-like" type (one that acts like java.util.Map but does not implement it).

Deserializer for element type may be passed, if configured explicitly at higher level (by annotations, typically), but usually are not. Type deserializer for element is passed if one is needed based on contextual information (annotations on declared element class; or on field or method type is associated with).

Similarly, a KeyDeserializer may be passed, but this is only done if there is a specific configuration override (annotations) to indicate instance to use. Otherwise null is passed, and key deserializer needs to be obtained later during resolution (using ResolvableDeserializer#resolve).

Parameters
type:MapLikeType

Type of java.util.Map instances to deserialize

config:DeserializationConfig

Configuration in effect

beanDesc:BeanDescription

Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers

keyDeserializer:KeyDeserializer

Key deserializer use, if it is defined via annotations or other configuration; null if default key deserializer for key type can be used.

elementTypeDeserializer:TypeDeserializer

If element type needs polymorphic type handling, this is the type information deserializer to use; should usually be used as is when constructing array deserializer.

elementDeserializer:JsonDeserializer<?>

Deserializer to use for elements, if explicitly defined (by using annotations, for exmple). May be null, in which case it should be resolved here (or using ResolvableDeserializer callback)

Returns:JsonDeserializer<?>

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
findReferenceDeserializerback to summary
public JsonDeserializer<?> findReferenceDeserializer(ReferenceType refType, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer contentTypeDeserializer, JsonDeserializer<?> contentDeserializer)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findReferenceDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findReferenceDeserializer.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findReferenceDeserializer.

Method called to locate deserializer for value that is of referential type,

Parameters
refType:ReferenceType

Specific referential type to deserialize

config:DeserializationConfig

Configuration in effect

beanDesc:BeanDescription

Definition of the reference type that contains class annotations and other information typically needed for building deserializers

contentTypeDeserializer:TypeDeserializer

Possible type deserializer for referenced value

contentDeserializer:JsonDeserializer<?>

Value deserializer to use for referenced value, if indicated by property annotation

Returns:JsonDeserializer<?>

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
hasDeserializerForback to summary
public boolean hasDeserializerFor(DeserializationConfig config, Class<?> valueType)

Overrides default com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer. Mostly needed to support validation of polymorphic type ids.

Note

implementations should take care NOT to claim supporting types that they do not recognize as this could to incorrect assumption of safe support by caller.

Method added in Jackson 2.13 now that Java 8 default implementations are available for use with interface definitions.

Annotations
@Override
requireCollectionOfComparableElementsback to summary
private void requireCollectionOfComparableElements(CollectionType actualType, String targetType)