Package java.lang.reflect
Class UndeclaredThrowableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.reflect.UndeclaredThrowableException
- All Implemented Interfaces:
Serializable
public class UndeclaredThrowableException extends RuntimeException
This class provides a wrapper for an undeclared, checked exception thrown by
an InvocationHandler.
-
Constructor Summary
Constructors Constructor Description UndeclaredThrowableException(Throwable exception)Constructs a newUndeclaredThrowableExceptioninstance with the undeclared, checked exception that occurred.UndeclaredThrowableException(Throwable exception, String detailMessage)Constructs a newUndeclaredThrowableExceptioninstance with the undeclared, checked exception that occurred and a message. -
Method Summary
Modifier and Type Method Description ThrowablegetCause()Returns the undeclared, checked exception that occurred, which may benull.ThrowablegetUndeclaredThrowable()Returns the undeclared, checked exception that occurred, which may benull.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UndeclaredThrowableException
Constructs a newUndeclaredThrowableExceptioninstance with the undeclared, checked exception that occurred.- Parameters:
exception- the undeclared, checked exception that occurred
-
UndeclaredThrowableException
Constructs a newUndeclaredThrowableExceptioninstance with the undeclared, checked exception that occurred and a message.- Parameters:
detailMessage- the detail message for the exceptionexception- the undeclared, checked exception that occurred
-
-
Method Details
-
getUndeclaredThrowable
Returns the undeclared, checked exception that occurred, which may benull.- Returns:
- the undeclared, checked exception that occurred
-
getCause
Returns the undeclared, checked exception that occurred, which may benull.
-