27
28 /**
29 * InvocationTargetException is a checked exception that wraps
30 * an exception thrown by an invoked method or constructor.
31 *
32 * <p>As of release 1.4, this exception has been retrofitted to conform to
33 * the general purpose exception-chaining mechanism. The "target exception"
34 * that is provided at construction time and accessed via the
35 * {@link #getTargetException()} method is now known as the <i>cause</i>,
36 * and may be accessed via the {@link Throwable#getCause()} method,
37 * as well as the aforementioned "legacy method."
38 *
39 * @see Method
40 * @see Constructor
41 * @since 1.1
42 */
43 public class InvocationTargetException extends ReflectiveOperationException {
44 /**
45 * Use serialVersionUID from JDK 1.1.X for interoperability
46 */
47 private static final long serialVersionUID = 4085088731926701167L;
48
49 /**
50 * This field holds the target if the
51 * InvocationTargetException(Throwable target) constructor was
52 * used to instantiate the object
53 *
54 * @serial
55 *
56 */
57 private Throwable target;
58
59 /**
60 * Constructs an {@code InvocationTargetException} with
61 * {@code null} as the target exception.
62 */
63 protected InvocationTargetException() {
64 super((Throwable)null); // Disallow initCause
65 }
66
|
27
28 /**
29 * InvocationTargetException is a checked exception that wraps
30 * an exception thrown by an invoked method or constructor.
31 *
32 * <p>As of release 1.4, this exception has been retrofitted to conform to
33 * the general purpose exception-chaining mechanism. The "target exception"
34 * that is provided at construction time and accessed via the
35 * {@link #getTargetException()} method is now known as the <i>cause</i>,
36 * and may be accessed via the {@link Throwable#getCause()} method,
37 * as well as the aforementioned "legacy method."
38 *
39 * @see Method
40 * @see Constructor
41 * @since 1.1
42 */
43 public class InvocationTargetException extends ReflectiveOperationException {
44 /**
45 * Use serialVersionUID from JDK 1.1.X for interoperability
46 */
47 @java.io.Serial
48 private static final long serialVersionUID = 4085088731926701167L;
49
50 /**
51 * This field holds the target if the
52 * InvocationTargetException(Throwable target) constructor was
53 * used to instantiate the object
54 *
55 * @serial
56 *
57 */
58 private Throwable target;
59
60 /**
61 * Constructs an {@code InvocationTargetException} with
62 * {@code null} as the target exception.
63 */
64 protected InvocationTargetException() {
65 super((Throwable)null); // Disallow initCause
66 }
67
|