Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.lang.reflect

Class InvocationTargetException

java.lang.Object
|
+--java.lang.Throwable
   |
   +--java.lang.Exception
      |
      +--java.lang.reflect.InvocationTargetException


public class InvocationTargetException

extends Exception

InvocationTargetException is sort of a way to "wrap" whatever exception comes up when a method or constructor is called via Reflection. As of JDK 1.4, it was retrofitted to match the exception chaining of all other exceptions, but getTargetException() still works.

Since:Authors:See Also:

Constructor Summary

InvocationTargetException()

Construct an exception with null as the cause.
InvocationTargetException(java.lang.Throwable targetException)

Create an InvocationTargetException using another exception.
InvocationTargetException(java.lang.Throwable targetException, java.lang.String err)

Create an InvocationTargetException using another exception and an error message.

Method Summary

java.lang.ThrowablegetCause()

Returns the cause of this exception (which may be null).
java.lang.ThrowablegetTargetException()

Get the wrapped (targeted) exception.

Constructor Details

InvocationTargetException

protected InvocationTargetException()

Construct an exception with null as the cause. The cause is initialized to null.


InvocationTargetException

public InvocationTargetException(java.lang.Throwable targetException)

Create an InvocationTargetException using another exception.

Parameters:


InvocationTargetException

public InvocationTargetException(java.lang.Throwable targetException, java.lang.String err)

Create an InvocationTargetException using another exception and an error message.

Parameters:


Method Details

getCause

public Throwable getCause()

Returns the cause of this exception (which may be null).

Since:Returns:


getTargetException

public Throwable getTargetException()

Get the wrapped (targeted) exception.

Returns:

See Also: