Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.lang.reflect
Class UndeclaredThrowableException  view UndeclaredThrowableException download UndeclaredThrowableException.java

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byjava.lang.reflect.UndeclaredThrowableException
All Implemented Interfaces:
java.io.Serializable

public class UndeclaredThrowableException
extends java.lang.RuntimeException

This exception class is thrown by a Proxy instance if the invoke 55 method of that instance's InvocationHandler attempts to throw an exception that not declared by the throws clauses of all of the interface methods that the proxy instance is implementing.

When thrown by Proxy, this class will always wrap a checked exception, never java.lang.Error or java.lang.RuntimeException, which are unchecked.

Since:
1.3

Nested Class Summary
 
Nested classes inherited from class java.lang.Throwable
 
Field Summary
private static long serialVersionUID
          Compatible with JDK 1.3+.
private  java.lang.Throwable undeclaredThrowable
          The immutable exception that this wraps.
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
UndeclaredThrowableException(java.lang.Throwable cause)
          Wraps the given checked exception into a RuntimeException, with no detail message.
UndeclaredThrowableException(java.lang.Throwable cause, java.lang.String message)
          Wraps the given checked exception into a RuntimeException, with the specified detail message.
 
Method Summary
 java.lang.Throwable getCause()
          Returns the cause of this exception.
 java.lang.Throwable getUndeclaredThrowable()
          Returns the cause of this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Compatible with JDK 1.3+.

See Also:
Constant Field Values

undeclaredThrowable

private final java.lang.Throwable undeclaredThrowable
The immutable exception that this wraps. This field is redundant with Throwable.getCause()>Throwable.getCause() 55 , but is necessary for serial compatibility.

Constructor Detail

UndeclaredThrowableException

public UndeclaredThrowableException(java.lang.Throwable cause)
Wraps the given checked exception into a RuntimeException, with no detail message. Throwable.initCause(Throwable)>Throwable.initCause(Throwable) 55 will fail on this instance.


UndeclaredThrowableException

public UndeclaredThrowableException(java.lang.Throwable cause,
                                    java.lang.String message)
Wraps the given checked exception into a RuntimeException, with the specified detail message. Throwable.initCause(Throwable)>Throwable.initCause(Throwable) 55 will fail on this instance.

Method Detail

getUndeclaredThrowable

public java.lang.Throwable getUndeclaredThrowable()
Returns the cause of this exception. If this exception was created by a Proxy instance, it will be a non-null checked exception. This method pre-dates exception chaining, and is now simply a longer way to call getCause().


getCause

public java.lang.Throwable getCause()
Returns the cause of this exception. If this exception was created by a Proxy instance, it will be a non-null checked exception.

Since:
1.4