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抛出。
也可以看看:
Public constructors |
|
|---|---|
EnumConstantNotPresentException(Class<? extends Enum> enumType, String constantName) 为指定的常量构造一个 EnumConstantNotPresentException 。 |
|
Public methods |
|
|---|---|
String |
constantName() 返回缺少的枚举常量的名称。 |
Class<? extends Enum> |
enumType() 返回缺少的枚举常量的类型。 |
Inherited methods |
|
|---|---|
java.lang.Throwable
|
|
java.lang.Object
|
|
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 |
String constantName ()
返回缺少的枚举常量的名称。
| Returns | |
|---|---|
String |
the name of the missing enum constant |
Class<? extends Enum> enumType ()
返回缺少的枚举常量的类型。
| Returns | |
|---|---|
Class<? extends Enum> |
the type of the missing enum constant |