|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--java.lang.RuntimeException | +--com.sas.net.util.RuntimeWrapperException
Base class for exceptions that may contain nested exceptions. When there is a nested exception, toString() and printStackTrace(), etc. defer to the nested exception.
If the nested exception is itself a WrapperException, then there will be yet another layer of deferal.
This is for unchecked exceptions. There is also a WrapperException to use as a base class for checked exceptions.
Java has it's own notion of a wrapper exception
in java.lang.reflect.InvocationTargetException
.
This class would not exist were it not for three
problems with InvocationTargetException.
This base class is often useful in the following
situation where AnException
extends
WrapperException
:
public void aMethod() throws AnException
{
try
{
doStuff();
}
catch (AnotherException e)
{
throw new AnException(e);
}
}
Constructor Summary | |
RuntimeWrapperException()
No-argument constructor. |
|
RuntimeWrapperException(java.lang.String message)
Constructor with message. |
|
RuntimeWrapperException(java.lang.String message,
java.lang.Throwable nestedException)
Wrapper constructor. |
|
RuntimeWrapperException(java.lang.Throwable nestedException)
Wrapper constructor. |
Method Summary | |
java.lang.Throwable |
fillInStackTrace()
|
java.lang.String |
getLocalizedMessage()
|
java.lang.String |
getMessage()
|
java.lang.Throwable |
getNestedException()
Gets the nested exception. |
void |
printStackTrace()
|
void |
printStackTrace(java.io.PrintStream p)
|
void |
printStackTrace(java.io.PrintWriter p)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public RuntimeWrapperException()
public RuntimeWrapperException(java.lang.String message)
message
- a message adding detail to the exceptionpublic RuntimeWrapperException(java.lang.Throwable nestedException)
nestedException
- exception being wrappedpublic RuntimeWrapperException(java.lang.String message, java.lang.Throwable nestedException)
message
- a message to include in the exception.nestedException
- an exception being wrapped.Method Detail |
public java.lang.String getMessage()
Throwable.getMessage()
public java.lang.String getLocalizedMessage()
Throwable.getLocalizedMessage()
public java.lang.String toString()
Throwable.toString()
public void printStackTrace()
Throwable.printStackTrace()
public void printStackTrace(java.io.PrintStream p)
Throwable.printStackTrace()
public void printStackTrace(java.io.PrintWriter p)
Throwable.printStackTrace()
public java.lang.Throwable fillInStackTrace()
Throwable.fillInStackTrace()
public java.lang.Throwable getNestedException()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |