* All files: Updated copyright to reflect Cygnus purchase.
[official-gcc.git] / libjava / java / lang / reflect / InvocationTargetException.java
blobc7b4f0192aa87015ad60cbd3d9c9155bf15012ea
1 // InvocationTargetException.java - Wrapper exception for reflection.
3 /* Copyright (C) 1998, 1999 Red Hat, Inc.
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 details. */
11 package java.lang.reflect;
12 import java.io.PrintStream;
13 import java.io.PrintWriter;
15 /**
16 * @author Tom Tromey <tromey@cygnus.com>
17 * @date December 12, 1998
19 /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
20 * "The Java Language Specification", ISBN 0-201-63451-1
21 * Status: Believed complete and correct.
24 public class InvocationTargetException extends Exception
26 public Throwable getTargetException ()
28 return target;
31 protected InvocationTargetException ()
33 super ();
34 target = null;
37 public InvocationTargetException (Throwable exception)
39 super ();
40 target = exception;
43 public InvocationTargetException (Throwable exception, String msg)
45 super (msg);
46 target = exception;
49 // This is from JDK 1.2.
50 public void printStackTrace ()
52 if (target != null)
53 target.printStackTrace();
56 // This is from JDK 1.2.
57 public void printStackTrace (PrintStream s)
59 if (target != null)
60 target.printStackTrace(s);
63 // This is from JDK 1.2.
64 public void printStackTrace (PrintWriter wr)
66 if (target != null)
67 target.printStackTrace(wr);
70 // The wrapped exception. The name is specified by the
71 // serialization spec.
72 private Throwable target;