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 EnumValuesprotected final EnumValuesMap with key as converted property class defined implementation ofEnumNamingStrategyand with value as Enum names collected usingEnum.name().Fields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnumKeySerializer(Class<?> enumType, EnumValues values) Deprecated.protectedEnumKeySerializer(Class<?> enumType, EnumValues values, EnumValues valuesByEnumNaming) -
Method Summary
Modifier and TypeMethodDescriptionconstruct(Class<?> enumType, EnumValues enumValues) construct(Class<?> enumType, EnumValues enumValues, EnumValues valuesByEnumNaming) voidserialize(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, wrapAndThrowMethods 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 ofEnumNamingStrategyand 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:ValueSerializerMethod that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serializein 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
-