com.fasterxml.jackson.databind.util

Class EnumResolver<T extends Enum<T>>

  • All Implemented Interfaces:
    Serializable


    public class EnumResolver<T extends Enum<T>>
    extends Object
    implements Serializable
    Helper class used to resolve String values (either JSON Object field names or regular String values) into Java Enum instances.
    See Also:
    Serialized Form
    • Field Detail

      • _enumClass

        protected final Class<T extends Enum<T>> _enumClass
      • _enums

        protected final T extends Enum<T>[] _enums
    • Method Detail

      • constructFor

        public static <ET extends Enum<ET>> EnumResolver<ET> constructFor(Class<ET> enumCls,
                                                          AnnotationIntrospector ai)
        Factory method for constructing resolver that maps from Enum.name() into Enum value
      • constructUsingToString

        public static <ET extends Enum<ET>> EnumResolver<ET> constructUsingToString(Class<ET> enumCls)
        Factory method for constructing resolver that maps from Enum.toString() into Enum value
      • constructUsingMethod

        public static <ET extends Enum<ET>> EnumResolver<ET> constructUsingMethod(Class<ET> enumCls,
                                                                  Method accessor)
      • constructUnsafe

        public static EnumResolver<?> constructUnsafe(Class<?> rawEnumCls,
                                      AnnotationIntrospector ai)
        This method is needed because of the dynamic nature of constructing Enum resolvers.
      • constructUnsafeUsingMethod

        public static EnumResolver<?> constructUnsafeUsingMethod(Class<?> rawEnumCls,
                                                 Method accessor)
        Method used when actual String serialization is indicated using @JsonValue on a method.
      • findEnum

        public T findEnum(String key)
      • getEnum

        public T getEnum(int index)
      • getEnums

        public List<T> getEnums()
      • getEnumClass

        public Class<T> getEnumClass()
      • lastValidIndex

        public int lastValidIndex()

Copyright © 2014-2015 FasterXML. All Rights Reserved.