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.PropertySerializerMapIf value type can not be statically determined, mapping from runtime value types to serializers are stored in this object.protected final ObjectThe 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.BeanPropertyprotected final booleanFlag set if output is forced to be sorted by keys (usually due to annotation).private final com.fasterxml.jackson.databind.type.MapLikeTypeprivate final com.fasterxml.jackson.databind.JsonSerializer<Object> private final com.fasterxml.jackson.databind.jsontype.TypeSerializerprivate static final longFields 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) protectedCacheSerializer(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) voidacceptJsonFormatVisitor(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.JavaTypebooleanhasSingleElement(com.google.common.cache.Cache<?, ?> cache) booleanisEmpty(com.fasterxml.jackson.databind.SerializerProvider prov, com.google.common.cache.Cache<?, ?> value) voidserialize(com.google.common.cache.Cache<?, ?> value, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) private voidserializeFields(Map<?, ?> mmap, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) private voidserializeFilteredFields(Map<?, ?> map, com.fasterxml.jackson.core.JsonGenerator gen, com.fasterxml.jackson.databind.SerializerProvider provider) voidserializeWithType(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 CacheSerializerwithResolved(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, withValueTypeSerializerMethods 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, wrapAndThrowMethods 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
-
_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:
_withValueTypeSerializerin 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:
createContextualin interfacecom.fasterxml.jackson.databind.ser.ContextualSerializer- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
getContentSerializer
public com.fasterxml.jackson.databind.JsonSerializer<?> getContentSerializer()- Specified by:
getContentSerializerin classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,?>>
-
getContentType
public com.fasterxml.jackson.databind.JavaType getContentType()- Specified by:
getContentTypein classcom.fasterxml.jackson.databind.ser.ContainerSerializer<com.google.common.cache.Cache<?,?>>
-
hasSingleElement
public boolean hasSingleElement(com.google.common.cache.Cache<?, ?> cache) - Specified by:
hasSingleElementin 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:
isEmptyin 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:
serializein 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:
serializeWithTypein 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:
acceptJsonFormatVisitorin interfacecom.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable- Overrides:
acceptJsonFormatVisitorin 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
-