Package java.lang.reflect
Class InvocationTargetException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.ReflectiveOperationException
java.lang.reflect.InvocationTargetException
- All Implemented Interfaces:
Serializable
public class InvocationTargetException extends ReflectiveOperationException
This class provides a wrapper for an exception thrown by a
Method or
Constructor invocation.-
Constructor Summary
Constructors Modifier Constructor Description protectedInvocationTargetException()Constructs a newInvocationTargetExceptioninstance with anullcause / target exception.InvocationTargetException(Throwable exception)Constructs a newInvocationTargetExceptioninstance with its cause / target exception filled in.InvocationTargetException(Throwable exception, String detailMessage)Constructs a newInvocationTargetExceptioninstance with its cause / target exception and message filled in. -
Method Summary
Modifier and Type Method Description ThrowablegetCause()Returns the cause of this exception, which may benull.ThrowablegetTargetException()Returns the target exception, which may benull.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InvocationTargetException
protected InvocationTargetException()Constructs a newInvocationTargetExceptioninstance with anullcause / target exception. -
InvocationTargetException
Constructs a newInvocationTargetExceptioninstance with its cause / target exception filled in.- Parameters:
exception- the exception which occurred while running the Method or Constructor
-
InvocationTargetException
Constructs a newInvocationTargetExceptioninstance with its cause / target exception and message filled in.- Parameters:
detailMessage- the detail message for the exceptionexception- the exception which occurred while running the Method or Constructor
-
-
Method Details