Class CacheSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<com.google.common.cache.Cache<?,?>>
com.fasterxml.jackson.databind.ser.std.StdSerializer<com.google.common.cache.Cache<?,?>>
com.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,?>>
com.fasterxml.jackson.datatype.guava.ser.CacheSerializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
,com.fasterxml.jackson.databind.jsonschema.SchemaAware
,com.fasterxml.jackson.databind.ser.ContextualSerializer
,Serializable
public class CacheSerializer
extends com.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,?>>
implements com.fasterxml.jackson.databind.ser.ContextualSerializer
Serializer for Guava's
Cache
values.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
com.fasterxml.jackson.databind.JsonSerializer.None
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap
If value type can not be statically determined, mapping from runtime value types to serializers are stored in this object.protected final Object
The id of the property filter to use, if any; null if none.Set of entries to omit during serialization, if anyprivate final com.fasterxml.jackson.databind.JsonSerializer
<Object> private final com.fasterxml.jackson.databind.BeanProperty
protected final boolean
Flag set if output is forced to be sorted by keys (usually due to annotation).private final com.fasterxml.jackson.databind.type.MapLikeType
private final com.fasterxml.jackson.databind.JsonSerializer
<Object> private final com.fasterxml.jackson.databind.jsontype.TypeSerializer
private static final long
Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCacheSerializer
(com.fasterxml.jackson.databind.type.MapLikeType type, com.fasterxml.jackson.databind.BeanDescription beanDesc, com.fasterxml.jackson.databind.JsonSerializer<Object> keySerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<Object> valueSerializer, Set<String> ignoredEntries, Object filterId) protected
CacheSerializer
(CacheSerializer src, com.fasterxml.jackson.databind.BeanProperty property, com.fasterxml.jackson.databind.JsonSerializer<?> keySerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<?> valueSerializer, Set<String> ignoredEntries, Object filterId, boolean sortKeys) -
Method Summary
Modifier and TypeMethodDescriptionprotected final com.fasterxml.jackson.databind.JsonSerializer
<Object> _findAndAddDynamic
(com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap map, com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.SerializerProvider provider) protected final com.fasterxml.jackson.databind.JsonSerializer
<Object> _findAndAddDynamic
(com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap map, Class<?> type, com.fasterxml.jackson.databind.SerializerProvider provider) protected Map
<?, ?> _orderEntriesByKey
(Map<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) protected com.fasterxml.jackson.databind.ser.ContainerSerializer
<?> _withValueTypeSerializer
(com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) protected void
_writeContents
(com.google.common.cache.Cache<?, ?> cache, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) void
acceptJsonFormatVisitor
(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor, com.fasterxml.jackson.databind.JavaType typeHint) com.fasterxml.jackson.databind.JsonSerializer
<?> createContextual
(com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.BeanProperty property) com.fasterxml.jackson.databind.JsonSerializer
<?> com.fasterxml.jackson.databind.JavaType
boolean
hasSingleElement
(com.google.common.cache.Cache<?, ?> cache) boolean
isEmpty
(com.fasterxml.jackson.databind.SerializerProvider prov, com.google.common.cache.Cache<?, ?> value) void
serialize
(com.google.common.cache.Cache<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) private void
serializeFields
(Map<?, ?> mmap, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) private void
serializeFilteredFields
(Map<?, ?> map, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) void
serializeWithType
(com.google.common.cache.Cache<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider ctxt, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) protected CacheSerializer
withResolved
(com.fasterxml.jackson.databind.BeanProperty property, com.fasterxml.jackson.databind.JsonSerializer<?> keySer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<?> valueSer, Set<String> ignored, Object filterId, boolean sortKeys) Methods inherited from class com.fasterxml.jackson.databind.ser.ContainerSerializer
hasContentTypeAnnotation, withValueTypeSerializer
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
_type
private final com.fasterxml.jackson.databind.type.MapLikeType _type -
_property
private final com.fasterxml.jackson.databind.BeanProperty _property -
_keySerializer
-
_valueTypeSerializer
private final com.fasterxml.jackson.databind.jsontype.TypeSerializer _valueTypeSerializer -
_valueSerializer
-
_ignoredEntries
Set of entries to omit during serialization, if any- Since:
- 2.16
-
_filterId
The id of the property filter to use, if any; null if none.- Since:
- 2.16
-
_sortKeys
protected final boolean _sortKeysFlag set if output is forced to be sorted by keys (usually due to annotation).- Since:
- 2.16
-
_dynamicValueSerializers
protected com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap _dynamicValueSerializersIf value type can not be statically determined, mapping from runtime value types to serializers are stored in this object.- Since:
- 2.16
-
-
Constructor Details
-
CacheSerializer
public CacheSerializer(com.fasterxml.jackson.databind.type.MapLikeType type, com.fasterxml.jackson.databind.BeanDescription beanDesc, com.fasterxml.jackson.databind.JsonSerializer<Object> keySerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<Object> valueSerializer, Set<String> ignoredEntries, Object filterId) - Since:
- 2.16
-
CacheSerializer
protected CacheSerializer(CacheSerializer src, com.fasterxml.jackson.databind.BeanProperty property, com.fasterxml.jackson.databind.JsonSerializer<?> keySerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<?> valueSerializer, Set<String> ignoredEntries, Object filterId, boolean sortKeys) - Since:
- 2.16
-
-
Method Details
-
withResolved
protected CacheSerializer withResolved(com.fasterxml.jackson.databind.BeanProperty property, com.fasterxml.jackson.databind.JsonSerializer<?> keySer, com.fasterxml.jackson.databind.jsontype.TypeSerializer vts, com.fasterxml.jackson.databind.JsonSerializer<?> valueSer, Set<String> ignored, Object filterId, boolean sortKeys) - Since:
- 2.16
-
_withValueTypeSerializer
protected com.fasterxml.jackson.databind.ser.ContainerSerializer<?> _withValueTypeSerializer(com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) - Specified by:
_withValueTypeSerializer
in classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,
?>>
-
createContextual
public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException - Specified by:
createContextual
in interfacecom.fasterxml.jackson.databind.ser.ContextualSerializer
- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
getContentSerializer
public com.fasterxml.jackson.databind.JsonSerializer<?> getContentSerializer()- Specified by:
getContentSerializer
in classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,
?>>
-
getContentType
public com.fasterxml.jackson.databind.JavaType getContentType()- Specified by:
getContentType
in classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,
?>>
-
hasSingleElement
public boolean hasSingleElement(com.google.common.cache.Cache<?, ?> cache) - Specified by:
hasSingleElement
in classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,
?>>
-
isEmpty
public boolean isEmpty(com.fasterxml.jackson.databind.SerializerProvider prov, com.google.common.cache.Cache<?, ?> value) - Overrides:
isEmpty
in classcom.fasterxml.jackson.databind.JsonSerializer<com.google.common.cache.Cache<?,
?>>
-
serialize
public void serialize(com.google.common.cache.Cache<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException- Specified by:
serialize
in classcom.fasterxml.jackson.databind.ser.std.StdSerializer<com.google.common.cache.Cache<?,
?>> - Throws:
IOException
-
serializeWithType
public void serializeWithType(com.google.common.cache.Cache<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider ctxt, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws IOException- Overrides:
serializeWithType
in classcom.fasterxml.jackson.databind.JsonSerializer<com.google.common.cache.Cache<?,
?>> - Throws:
IOException
-
_writeContents
protected void _writeContents(com.google.common.cache.Cache<?, ?> cache, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException- Throws:
IOException
- Since:
- 2.16
-
serializeFields
private void serializeFields(Map<?, ?> mmap, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException- Throws:
IOException
- Since:
- 2.16
-
serializeFilteredFields
private void serializeFilteredFields(Map<?, ?> map, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException- Throws:
IOException
- Since:
- 2.16
-
acceptJsonFormatVisitor
public void acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor, com.fasterxml.jackson.databind.JavaType typeHint) throws com.fasterxml.jackson.databind.JsonMappingException - Specified by:
acceptJsonFormatVisitor
in interfacecom.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable
- Overrides:
acceptJsonFormatVisitor
in classcom.fasterxml.jackson.databind.ser.std.StdSerializer<com.google.common.cache.Cache<?,
?>> - Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
_orderEntriesByKey
protected Map<?,?> _orderEntriesByKey(Map<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException- Throws:
IOException
- Since:
- 2.16
-
_findAndAddDynamic
protected final com.fasterxml.jackson.databind.JsonSerializer<Object> _findAndAddDynamic(com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap map, Class<?> type, com.fasterxml.jackson.databind.SerializerProvider provider) throws com.fasterxml.jackson.databind.JsonMappingException - Throws:
com.fasterxml.jackson.databind.JsonMappingException
- Since:
- 2.16
-
_findAndAddDynamic
protected final com.fasterxml.jackson.databind.JsonSerializer<Object> _findAndAddDynamic(com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap map, com.fasterxml.jackson.databind.JavaType type, com.fasterxml.jackson.databind.SerializerProvider provider) throws com.fasterxml.jackson.databind.JsonMappingException - Throws:
com.fasterxml.jackson.databind.JsonMappingException
- Since:
- 2.16
-