java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.reflect.UndeclaredThrowableException
- 所有已实现的接口:
-
Serializable
如果代理实例的调用处理程序的
invoke方法抛出一个已检查异常(一个不能赋值给RuntimeException或Error的Throwable),而该异常又不能赋值给代理实例上调用并分派给调用处理程序的方法的throws子句中声明的任何异常类型,则会抛出此异常。
UndeclaredThrowableException实例包含调用处理程序抛出的未声明的已检查异常,可以使用getUndeclaredThrowable()方法检索该异常。 UndeclaredThrowableException扩展了RuntimeException,因此它是一个未检查的异常,用于包装已检查的异常。
- 自从:
- 1.3
- 参见:
-
Constructor Summary
ConstructorsConstructorDescriptionUndeclaredThrowableException(Throwable undeclaredThrowable) 使用指定的Throwable构造一个UndeclaredThrowableException。UndeclaredThrowableException(Throwable undeclaredThrowable, String s) 使用指定的Throwable和详细消息构造一个UndeclaredThrowableException。 -
Method Summary
Modifier and TypeMethodDescription返回包装在此UndeclaredThrowableException中的Throwable实例,可能为null。Methods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UndeclaredThrowableException
使用指定的Throwable构造一个UndeclaredThrowableException。- 参数:
-
undeclaredThrowable- 被抛出的未声明的已检查异常
-
UndeclaredThrowableException
使用指定的Throwable和详细消息构造一个UndeclaredThrowableException。- 参数:
-
undeclaredThrowable- 被抛出的未声明的已检查异常 -
s- 详细消息
-
-
Method Details
-
getUndeclaredThrowable
返回包装在此UndeclaredThrowableException中的Throwable实例,可能为null。- API注释:
-
此方法早于通用异常链接功能。现在,
Throwable.getCause()方法是获取此信息的首选方法。 - 返回:
- 被抛出的未声明的已检查异常
-