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 |
Modifier | Constructor and Description |
---|---|
protected |
EnumResolver(Class<Enum<?>> enumClass,
Enum<?>[] enums,
HashMap<String,Enum<?>> map,
Enum<?> defaultValue) |
Modifier and Type | Method and Description |
---|---|
static EnumResolver |
constructFor(Class<Enum<?>> enumCls,
AnnotationIntrospector ai)
Factory method for constructing resolver that maps from Enum.name() into
Enum value
|
CompactStringObjectMap |
constructLookup() |
static EnumResolver |
constructUnsafe(Class<?> rawEnumCls,
AnnotationIntrospector ai)
This method is needed because of the dynamic nature of constructing Enum
resolvers.
|
static EnumResolver |
constructUnsafeUsingMethod(Class<?> rawEnumCls,
AnnotatedMember accessor,
AnnotationIntrospector ai)
Method used when actual String serialization is indicated using @JsonValue
on a method.
|
static EnumResolver |
constructUnsafeUsingToString(Class<?> rawEnumCls,
AnnotationIntrospector ai)
Method that needs to be used instead of
constructUsingToString(java.lang.Class<java.lang.Enum<?>>)
if static type of enum is not known. |
static EnumResolver |
constructUsingMethod(Class<Enum<?>> enumCls,
AnnotatedMember accessor,
AnnotationIntrospector ai) |
static EnumResolver |
constructUsingToString(Class<Enum<?>> enumCls)
Deprecated.
Since 2.8, use
constructUsingToString(Class, AnnotationIntrospector) instead |
static EnumResolver |
constructUsingToString(Class<Enum<?>> enumCls,
AnnotationIntrospector ai)
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() |
int |
lastValidIndex() |
protected final Enum<?>[] _enums
protected final Enum<?> _defaultValue
public static EnumResolver constructFor(Class<Enum<?>> enumCls, AnnotationIntrospector ai)
@Deprecated public static EnumResolver constructUsingToString(Class<Enum<?>> enumCls)
constructUsingToString(Class, AnnotationIntrospector)
insteadpublic static EnumResolver constructUsingToString(Class<Enum<?>> enumCls, AnnotationIntrospector ai)
public static EnumResolver constructUsingMethod(Class<Enum<?>> enumCls, AnnotatedMember accessor, AnnotationIntrospector ai)
public static EnumResolver constructUnsafe(Class<?> rawEnumCls, AnnotationIntrospector ai)
public static EnumResolver constructUnsafeUsingToString(Class<?> rawEnumCls, AnnotationIntrospector ai)
constructUsingToString(java.lang.Class<java.lang.Enum<?>>)
if static type of enum is not known.public static EnumResolver constructUnsafeUsingMethod(Class<?> rawEnumCls, AnnotatedMember accessor, AnnotationIntrospector ai)
public CompactStringObjectMap constructLookup()
public Enum<?> getEnum(int index)
public Enum<?> getDefaultValue()
public Enum<?>[] getRawEnums()
public Collection<String> getEnumIds()
public int lastValidIndex()
Copyright © 2008–2020 FasterXML. All rights reserved.