Web Site

org.codehaus.janino.util
Class TunnelException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.codehaus.janino.util.TunnelException
All Implemented Interfaces:
Serializable

public class TunnelException
extends RuntimeException

Redirects all methods to the delegate Throwable.

This class is useful if you want to throw a non-RuntimeException-derived Exception, but cannot declare it in the "throws" clause of your method, because your method overrides a method of a base class. The classical example is ClassLoader.findClass(String), which allows only ClassNotFoundException to be thrown, but you want to implement a more elaborate exception handling.

To make clear which exceptions wrapped in TunnelException your method would throw, it is recommended that you declare them with a "throws TunnelException" clause and that you document them in JAVADOC with @throws clauses like this:

 /**
  * ...
  * @throws TunnelException Wraps a {@link FooException} - Problems writing a Foo
  * @throws TunnelException Wraps a {@link BarException} - The Bar could not be opened
  */
 

See Also:
Serialized Form

Constructor Summary
TunnelException(Throwable delegate)
           
 
Method Summary
 Throwable getDelegate()
           
 String getLocalizedMessage()
           
 String getMessage()
           
 void printStackTrace()
           
 void printStackTrace(PrintStream ps)
           
 void printStackTrace(PrintWriter pw)
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TunnelException

public TunnelException(Throwable delegate)
Method Detail

getDelegate

public Throwable getDelegate()

getLocalizedMessage

public String getLocalizedMessage()

getMessage

public String getMessage()

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintStream ps)

printStackTrace

public void printStackTrace(PrintWriter pw)

toString

public String toString()

Web Site