public class EnumResolver<T extends Enum<T>> extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
_enumClass |
protected T[] |
_enums |
protected HashMap<String,T> |
_enumsById |
Modifier | Constructor and Description |
---|---|
protected |
EnumResolver(Class<T> enumClass,
T[] enums,
HashMap<String,T> map) |
Modifier and Type | Method and Description |
---|---|
static <ET extends Enum<ET>> |
constructFor(Class<ET> enumCls,
AnnotationIntrospector ai)
Factory method for constructing resolver that maps from Enum.name() into
Enum value
|
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<ET>)
if static type of enum is not known. |
static <ET extends Enum<ET>> |
constructUsingMethod(Class<ET> enumCls,
Method accessor) |
static <ET extends Enum<ET>> |
constructUsingToString(Class<ET> enumCls)
Factory method for constructing resolver that maps from Enum.toString() into
Enum value
|
T |
findEnum(String key) |
T |
getEnum(int index) |
Class<T> |
getEnumClass() |
List<T> |
getEnums() |
int |
lastValidIndex() |
public static <ET extends Enum<ET>> EnumResolver<ET> constructFor(Class<ET> enumCls, AnnotationIntrospector ai)
public static <ET extends Enum<ET>> EnumResolver<ET> constructUsingToString(Class<ET> enumCls)
public static <ET extends Enum<ET>> EnumResolver<ET> constructUsingMethod(Class<ET> enumCls, Method accessor)
public static EnumResolver<?> constructUnsafe(Class<?> rawEnumCls, AnnotationIntrospector ai)
public static EnumResolver<?> constructUnsafeUsingToString(Class<?> rawEnumCls)
constructUsingToString(java.lang.Class<ET>)
if static type of enum is not known.public static EnumResolver<?> constructUnsafeUsingMethod(Class<?> rawEnumCls, Method accessor)
public T getEnum(int index)
public int lastValidIndex()
Copyright © 2016 JBoss by Red Hat. All rights reserved.