Module tools.jackson.databind
Package tools.jackson.databind.ser.jdk
Class JDKKeySerializers.EnumKeySerializer
java.lang.Object
tools.jackson.databind.ValueSerializer<T>
tools.jackson.databind.ser.std.StdSerializer<Object>
tools.jackson.databind.ser.jdk.JDKKeySerializers.EnumKeySerializer
- All Implemented Interfaces:
JsonFormatVisitable
- Enclosing class:
- JDKKeySerializers
Specialized instance to use for Enum keys, as per [databind#1322]
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueSerializer
ValueSerializer.None
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EnumValues
protected final EnumValues
Map with key as converted property class defined implementation ofEnumNamingStrategy
and with value as Enum names collected usingEnum.name()
.Fields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EnumKeySerializer
(Class<?> enumType, EnumValues values) Deprecated.protected
EnumKeySerializer
(Class<?> enumType, EnumValues values, EnumValues valuesByEnumNaming) -
Method Summary
Modifier and TypeMethodDescriptionconstruct
(Class<?> enumType, EnumValues enumValues) construct
(Class<?> enumType, EnumValues enumValues, EnumValues valuesByEnumNaming) void
serialize
(Object value, JsonGenerator g, SerializationContext serializers) Method that can be called to ask implementation to serialize values of type this serializer handles.Methods inherited from class tools.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitor, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
Methods inherited from class tools.jackson.databind.ValueSerializer
createContextual, getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, resolve, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Field Details
-
_values
-
_valuesByEnumNaming
Map with key as converted property class defined implementation ofEnumNamingStrategy
and with value as Enum names collected usingEnum.name()
.
-
-
Constructor Details
-
EnumKeySerializer
Deprecated. -
EnumKeySerializer
-
-
Method Details
-
construct
public static JDKKeySerializers.EnumKeySerializer construct(Class<?> enumType, EnumValues enumValues) -
construct
public static JDKKeySerializers.EnumKeySerializer construct(Class<?> enumType, EnumValues enumValues, EnumValues valuesByEnumNaming) -
serialize
public void serialize(Object value, JsonGenerator g, SerializationContext serializers) throws JacksonException Description copied from class:ValueSerializer
Method that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serialize
in classStdSerializer<Object>
- Parameters:
value
- Value to serialize; can not be null.g
- Generator used to output resulting Json contentserializers
- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
JacksonException
-