org.codehaus.janino.util
Class TunnelException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.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
TunnelException
public TunnelException(Throwable delegate)
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()