InvocationTargetException


InvocationTargetException java.lang.reflect

Java 1.1 serializable checked

An object of this class is thrown by Method.invoke( ) and Constructor.newInstance( ) when an exception is thrown by the method or constructor invoked through those methods . The InvocationTargetException class serves as a wrapper around the object that was thrown; that object can be retrieved with the getTargetException( ) method. In Java 1.4 and later, all exceptions can be "chained" in this way, and getTargetException( ) is superseded by the more general getCause( ) method.

Figure 10-96. java.lang.reflect.InvocationTargetException

 public class  InvocationTargetException  extends Exception {  // Public Constructors  public  InvocationTargetException  (Throwable  target  );        public  InvocationTargetException  (Throwable  target  , String  s  );  // Protected Constructors  protected  InvocationTargetException  ( );  // Public Instance Methods  public Throwable  getTargetException  ( );  // Public Methods Overriding Throwable   1.4  public Throwable  getCause  ( );   } 

Thrown By

Constructor.newInstance( ) , Method.invoke( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net