public class EnumResolver extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected Enum<?> |
_defaultValue |
protected Class<Enum<?>> |
_enumClass |
protected Enum<?>[] |
_enums |
protected HashMap<String,Enum<?>> |
_enumsById |
protected boolean |
_isFromIntValue
Marker for case where value may come from
@JsonValue annotated
accessor and is expected/likely to come from actual integral number
value (and not String). |
protected boolean |
_isIgnoreCase
Marker for case-insensitive handling
|
Modifier | Constructor and Description |
---|---|
protected |
EnumResolver(Class<Enum<?>> enumClass,
Enum<?>[] enums,
HashMap<String,Enum<?>> map,
Enum<?> defaultValue)
Deprecated.
Since 2.12 (remove from 2.13+ not part of public API)
|
protected |
EnumResolver(Class<Enum<?>> enumClass,
Enum<?>[] enums,
HashMap<String,Enum<?>> map,
Enum<?> defaultValue,
boolean isIgnoreCase)
Deprecated.
Since 2.13
|
protected |
EnumResolver(Class<Enum<?>> enumClass,
Enum<?>[] enums,
HashMap<String,Enum<?>> map,
Enum<?> defaultValue,
boolean isIgnoreCase,
boolean isFromIntValue) |
Modifier and Type | Method and Description |
---|---|
protected static EnumResolver |
_constructFor(Class<?> enumCls0,
AnnotationIntrospector ai,
boolean isIgnoreCase) |
protected static EnumResolver |
_constructUsingMethod(Class<?> enumCls0,
AnnotatedMember accessor,
AnnotationIntrospector ai,
boolean isIgnoreCase) |
protected static EnumResolver |
_constructUsingToString(Class<?> enumCls0,
AnnotationIntrospector ai,
boolean isIgnoreCase) |
protected static Class<Enum<?>> |
_enumClass(Class<?> enumCls0) |
protected static Enum<?>[] |
_enumConstants(Class<?> enumCls) |
protected static Enum<?> |
_enumDefault(AnnotationIntrospector intr,
Class<?> enumCls) |
protected Enum<?> |
_findEnumCaseInsensitive(String key) |
protected static boolean |
_isIntType(Class<?> erasedType) |
static EnumResolver |
constructFor(Class<Enum<?>> enumCls,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructFor(DeserializationConfig config,
Class<?> enumCls)
Factory method for constructing resolver that maps from Enum.name() into
Enum value.
|
CompactStringObjectMap |
constructLookup() |
static EnumResolver |
constructUnsafe(Class<?> rawEnumCls,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructUnsafeUsingMethod(Class<?> rawEnumCls,
AnnotatedMember accessor,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructUnsafeUsingToString(Class<?> rawEnumCls,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructUsingMethod(Class<Enum<?>> enumCls,
AnnotatedMember accessor,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructUsingMethod(DeserializationConfig config,
Class<?> enumCls,
AnnotatedMember accessor)
Method used when actual String serialization is indicated using @JsonValue
on a method in Enum class.
|
static EnumResolver |
constructUsingToString(Class<Enum<?>> enumCls)
Deprecated.
Since 2.8 (remove from 2.13 or later)
|
static EnumResolver |
constructUsingToString(Class<Enum<?>> enumCls,
AnnotationIntrospector ai)
Deprecated.
Since 2.12
|
static EnumResolver |
constructUsingToString(DeserializationConfig config,
Class<?> enumCls)
Factory method for constructing resolver that maps from Enum.toString() into
Enum value
|
Enum<?> |
findEnum(String key) |
Enum<?> |
getDefaultValue() |
Enum<?> |
getEnum(int index) |
Class<Enum<?>> |
getEnumClass() |
Collection<String> |
getEnumIds() |
List<Enum<?>> |
getEnums() |
Enum<?>[] |
getRawEnums() |
boolean |
isFromIntValue()
Accessor for checking if we have a special case in which value to map
is from
@JsonValue annotated accessor with integral type: this
matters for cases where incoming content value is of integral type
and should be mapped to specific value and NOT to Enum.index() . |
int |
lastValidIndex() |
protected final Enum<?>[] _enums
protected final Enum<?> _defaultValue
protected final boolean _isIgnoreCase
protected final boolean _isFromIntValue
@JsonValue
annotated
accessor and is expected/likely to come from actual integral number
value (and not String).
Special case is needed since this specifically means that Enum.index()
should NOT be used or default to.
protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String,Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase, boolean isFromIntValue)
@Deprecated protected EnumResolver(Class<Enum<?>> enumClass, Enum<?>[] enums, HashMap<String,Enum<?>> map, Enum<?> defaultValue, boolean isIgnoreCase)
public static EnumResolver constructFor(DeserializationConfig config, Class<?> enumCls)
protected static EnumResolver _constructFor(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase)
public static EnumResolver constructUsingToString(DeserializationConfig config, Class<?> enumCls)
protected static EnumResolver _constructUsingToString(Class<?> enumCls0, AnnotationIntrospector ai, boolean isIgnoreCase)
public static EnumResolver constructUsingMethod(DeserializationConfig config, Class<?> enumCls, AnnotatedMember accessor)
protected static EnumResolver _constructUsingMethod(Class<?> enumCls0, AnnotatedMember accessor, AnnotationIntrospector ai, boolean isIgnoreCase)
public CompactStringObjectMap constructLookup()
protected static Enum<?> _enumDefault(AnnotationIntrospector intr, Class<?> enumCls)
protected static boolean _isIntType(Class<?> erasedType)
@Deprecated public static EnumResolver constructFor(Class<Enum<?>> enumCls, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUnsafe(Class<?> rawEnumCls, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUsingToString(Class<Enum<?>> enumCls, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUnsafeUsingToString(Class<?> rawEnumCls, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUsingToString(Class<Enum<?>> enumCls)
@Deprecated public static EnumResolver constructUsingMethod(Class<Enum<?>> enumCls, AnnotatedMember accessor, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUnsafeUsingMethod(Class<?> rawEnumCls, AnnotatedMember accessor, AnnotationIntrospector ai)
public Enum<?> getEnum(int index)
public Enum<?> getDefaultValue()
public Enum<?>[] getRawEnums()
public Collection<String> getEnumIds()
public int lastValidIndex()
public boolean isFromIntValue()
@JsonValue
annotated accessor with integral type: this
matters for cases where incoming content value is of integral type
and should be mapped to specific value and NOT to Enum.index()
.Copyright © 2008–2021 FasterXML. All rights reserved.