References Deprecated
StdScalarSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
See corresponding docs for further information.
java.lang.Enum types.
Based on StdScalarSerializer since the JSON value is
scalar (String).
| Modifier and Type | Field and Description |
|---|---|
| protected final Boolean | _serializeAsIndex
Flag that is set if we statically know serialization choice between index and textual format (null if it needs to be dynamically checked). |
| protected final EnumValues | _values
This map contains pre-resolved values (since there are ways to customize actual String constants to use) to use as serializations. |
| protected final EnumValues | _valuesByEnumNaming
Map with key as converted property class defined implementation of |
| protected final EnumValues | _valuesByToString
Map that contains pre-resolved values for |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | EnumSerializer(EnumValues v, Boolean serializeAsIndex, EnumValues valuesByEnumNaming)
Deprecated
Since 2.16
|
| public | EnumSerializer(EnumValues v, Boolean serializeAsIndex, EnumValues valuesByEnumNaming, EnumValues valuesByToString)
|
| Modifier and Type | Method and Description |
|---|---|
| protected static Boolean | _isShapeWrittenUsingIndex(Class<?> enumClass, JsonFormat.
Helper method called to check whether serialization should be done using index (number) or not. |
| protected final boolean | |
| public void | acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType
Type of element (entity like property) being visited typeHint)Overrides com. Implements com. Default implementation specifies no format. |
| public static EnumSerializer | construct(Class<?> enumClass, SerializationConfig config, BeanDescription beanDesc, JsonFormat.
References Deprecated
EnumSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Factory method used by |
| protected static EnumValues | constructEnumNamingStrategyValues(SerializationConfig config, Class<Enum<?>> enumClass, AnnotatedClass annotatedClass)
Factory method used to resolve an instance of |
| public JsonSerializer | createContextual(SerializerProvider
Serializer provider to use for accessing config, other serializers serializers, BeanProperty Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is) property)Implements com. To support some level of per-property configuration, we will need to make things contextual. |
| public EnumValues | |
| public JsonNode | getSchema(SerializerProvider
The serializer provider. provider, Type A hint about the type. typeHint)Overrides com. Implements com.
Deprecated
Since 2.15
Default implementation simply claims type is "string"; usually overriden by custom serializers. |
| public final void | serialize(Enum<?>
Value to serialize; can not be null. en, JsonGenerator Generator used to output resulting Json content gen, SerializerProvider Provider that can be used to get serializers for
serializing Objects value contains, if any. serializers)Implements abstract com. Method that can be called to ask implementation to serialize values of type this serializer handles. |
| _serializeAsIndex | back to summary |
|---|---|
| protected final Boolean _serializeAsIndex Flag that is set if we statically know serialization choice between index and textual format (null if it needs to be dynamically checked).
| |
| _values | back to summary |
|---|---|
| protected final EnumValues _values This map contains pre-resolved values (since there are ways to customize actual String constants to use) to use as serializations. | |
| _valuesByEnumNaming | back to summary |
|---|---|
| protected final EnumValues _valuesByEnumNaming Map with key as converted property class defined implementation of
| |
| _valuesByToString | back to summary |
|---|---|
| protected final EnumValues _valuesByToString Map that contains pre-resolved values for
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| EnumSerializer | back to summary |
|---|---|
| public EnumSerializer(EnumValues v, Boolean serializeAsIndex)
Deprecated Since 2.16
| |
| EnumSerializer | back to summary |
|---|---|
| public EnumSerializer(EnumValues v, Boolean serializeAsIndex, EnumValues valuesByEnumNaming)
Deprecated Since 2.16
| |
| EnumSerializer | back to summary |
|---|---|
public EnumSerializer(EnumValues v, Boolean serializeAsIndex, EnumValues valuesByEnumNaming, EnumValues valuesByToString)
| |
| _isShapeWrittenUsingIndex | back to summary |
|---|---|
| protected static Boolean _isShapeWrittenUsingIndex(Class<?> enumClass, JsonFormat. Helper method called to check whether serialization should be done using index (number) or not. | |
| _serializeAsIndex | back to summary |
|---|---|
| protected final boolean _serializeAsIndex(SerializerProvider serializers) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException Overrides com. Implements com. Doc from com. Default implementation specifies no format. This behavior is usually overriden by custom serializers.
| |
| construct | back to summary |
|---|---|
| public static EnumSerializer construct(Class<?> enumClass, SerializationConfig config, BeanDescription beanDesc, JsonFormat. References Deprecated
See corresponding docs for further information. Factory method used by
| |
| constructEnumNamingStrategyValues | back to summary |
|---|---|
| protected static EnumValues constructEnumNamingStrategyValues(SerializationConfig config, Class<Enum<?>> enumClass, AnnotatedClass annotatedClass) Factory method used to resolve an instance of
| |
| createContextual | back to summary |
|---|---|
| public JsonSerializer Implements com. To support some level of per-property configuration, we will need to make things contextual. We are limited to "textual vs index" choice here, however.
| |
| getEnumValues | back to summary |
|---|---|
| public EnumValues getEnumValues() | |
| getSchema | back to summary |
|---|---|
| public JsonNode getSchema(SerializerProvider provider, Type typeHint) Overrides com. Implements com. Doc from com. Deprecated Since 2.15 Default implementation simply claims type is "string"; usually overriden by custom serializers.
| |
| serialize | back to summary |
|---|---|
| public final void serialize(Enum<?> en, JsonGenerator gen, SerializerProvider serializers) throws IOException Implements abstract com. Doc from com. Method that can be called to ask implementation to serialize values of type this serializer handles.
| |