public class EnumResolver extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
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) |
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,
Method accessor)
Method used when actual String serialization is indicated using @JsonValue
on a method.
|
static EnumResolver |
constructUnsafeUsingToString(Class<?> rawEnumCls)
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,
Method accessor) |
static EnumResolver |
constructUsingToString(Class<Enum<?>> enumCls)
Factory method for constructing resolver that maps from Enum.toString() into
Enum value
|
Enum<?> |
findEnum(String key) |
Enum<?> |
getEnum(int index) |
Class<Enum<?>> |
getEnumClass() |
List<Enum<?>> |
getEnums() |
Enum<?>[] |
getRawEnums() |
int |
lastValidIndex() |
protected final Enum<?>[] _enums
public static EnumResolver constructFor(Class<Enum<?>> enumCls, AnnotationIntrospector ai)
public static EnumResolver constructUsingToString(Class<Enum<?>> enumCls)
public static EnumResolver constructUsingMethod(Class<Enum<?>> enumCls, Method accessor)
public static EnumResolver constructUnsafe(Class<?> rawEnumCls, AnnotationIntrospector ai)
public static EnumResolver constructUnsafeUsingToString(Class<?> rawEnumCls)
constructUsingToString(java.lang.Class<java.lang.Enum<?>>)
if static type of enum is not known.public static EnumResolver constructUnsafeUsingMethod(Class<?> rawEnumCls, Method accessor)
public CompactStringObjectMap constructLookup()
public Enum<?> getEnum(int index)
public Enum<?>[] getRawEnums()
public int lastValidIndex()
Copyright © 2014–2015 FasterXML. All rights reserved.