|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException orbital.util.InnerCheckedException
public class InnerCheckedException
This class is a InnerCheckedException which can be thrown if checked exceptions occur which cannot be declared in the throws-clause of a method, and must be wrapped in an unchecked RuntimeException to rethrow, instead.
This techique should only be used if a method-signature is required - for instance
by the java.lang.Runnable
interface - that does not
allow the declaration of checked exceptions.
The rethrow technique breaks a good java feature of checked exceptions.
A method which uses InnerCheckedExceptions will break its exception contract.
It is not a good style to use it except for signature requirements.
For example:
public void run() { try { ... } catch(AnyCheckedException x) {throw new InnerCheckedException(x);} }
Throwable.getCause()
,
Throwable.initCause(Throwable)
,
UndeclaredThrowableException
,
InvocationTargetException
,
Serialized FormField Summary | |
---|---|
protected java.lang.Throwable |
nested
nested inner exception that is checked and therefore cannot be thrown directly. |
Constructor Summary | |
---|---|
InnerCheckedException(java.lang.String message,
java.lang.Throwable cause)
|
|
InnerCheckedException(java.lang.Throwable inner)
|
|
InnerCheckedException(java.lang.Throwable cause,
java.lang.String message)
Deprecated. Since JDK1.4 use InnerCheckedException(String, Throwable) instead. |
Method Summary | |
---|---|
java.lang.Throwable |
getNextException()
Deprecated. Use Throwable.getCause() instead. |
void |
printStackTrace()
Prints the stack trace of the thrown nested exception to the specified print stream. |
void |
printStackTrace(java.io.PrintStream ps)
Prints the stack trace of the thrown nested exception to the specified print stream. |
void |
printStackTrace(java.io.PrintWriter pw)
Prints the stack trace of the thrown nested exception to the specified print writer. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Throwable nested
Constructor Detail |
---|
public InnerCheckedException(java.lang.Throwable inner)
public InnerCheckedException(java.lang.String message, java.lang.Throwable cause)
public InnerCheckedException(java.lang.Throwable cause, java.lang.String message)
InnerCheckedException(String, Throwable)
instead.
Method Detail |
---|
public java.lang.Throwable getNextException()
Throwable.getCause()
instead.
public void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream ps)
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintWriter pw)
printStackTrace
in class java.lang.Throwable
public java.lang.String toString()
toString
in class java.lang.Throwable
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |