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
FieldsFields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEnumKeySerializer(Class<?> enumType, EnumValuesToWrite valuesToWrite) -
Method Summary
Modifier and TypeMethodDescriptionconstruct(Class<?> enumType, EnumValuesToWrite valuesToWrite) voidserialize(Object value, JsonGenerator g, SerializationContext ctxt) 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
-
_valuesToWrite
-
-
Constructor Details
-
EnumKeySerializer
-
-
Method Details
-
construct
public static JDKKeySerializers.EnumKeySerializer construct(Class<?> enumType, EnumValuesToWrite valuesToWrite) -
serialize
public void serialize(Object value, JsonGenerator g, SerializationContext ctxt) 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 contentctxt- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
JacksonException
-