Most visited

Recently visited

Added in API level 1

EnumConstantNotPresentException

public class EnumConstantNotPresentException
extends RuntimeException

java.lang.Object
    java.lang.Throwable
      java.lang.Exception
        java.lang.RuntimeException
          java.lang.EnumConstantNotPresentException


当应用程序尝试按名称访问枚举常量并且枚举类型不包含具有指定名称的常量时抛出。 这个异常可以由API used to read annotations reflectively抛出。

也可以看看:

摘要(Summary)

Public constructors

EnumConstantNotPresentException(Class<? extends Enum> enumType, String constantName)

为指定的常量构造一个 EnumConstantNotPresentException

公共方法(Public methods)

String constantName()

返回缺少的枚举常量的名称。

Class<? extends Enum> enumType()

返回缺少的枚举常量的类型。

继承方法(Inherited methods)

From class java.lang.Throwable
From class java.lang.Object

Public constructors

EnumConstantNotPresentException

Added in API level 1
EnumConstantNotPresentException (Class<? extends Enum> enumType, 
                String constantName)

为指定的常量构造一个 EnumConstantNotPresentException

参数(Parameters)
enumType Class: the type of the missing enum constant
constantName String: the name of the missing enum constant

公共方法(Public methods)

constantName

Added in API level 1
String constantName ()

返回缺少的枚举常量的名称。

返回(Returns)
String the name of the missing enum constant

enumType

Added in API level 1
Class<? extends Enum> enumType ()

返回缺少的枚举常量的类型。

返回(Returns)
Class<? extends Enum> the type of the missing enum constant

Hooray!