|
|||||||||
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 gnu.mapping.WrappedException
public class WrappedException
Encapsulate some Exception inside a RuntimeException. Inspired by org.xml.sax.SAXException written by David Megginson.
Constructor Summary | |
---|---|
WrappedException()
Create a new WrappedException. |
|
WrappedException(java.lang.String message)
Create a new WrappedException. |
|
WrappedException(java.lang.String message,
java.lang.Throwable e)
Create a new WrappedException from an existing exception. |
|
WrappedException(java.lang.Throwable e)
Create a new WrappedException wrapping an existing exception. |
Method Summary | |
---|---|
java.lang.Throwable |
getException()
Return the embedded exception, if any. |
java.lang.String |
toString()
Convert this exception to a string. |
static java.lang.RuntimeException |
wrapIfNeeded(java.lang.Throwable ex)
Coerce argument to a RuntimeException. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WrappedException()
public WrappedException(java.lang.String message)
message
- The error or warning message.public WrappedException(java.lang.Throwable e)
The existing exception will be embedded in the new one, and its message will become the default message for the WrappedException.
e
- The exception to be wrapped in a WrappedException.public WrappedException(java.lang.String message, java.lang.Throwable e)
The existing exception will be embedded in the new one, but the new exception will have its own message.
message
- The detail message.e
- The exception to be wrapped in a WrappedException.Method Detail |
---|
public java.lang.Throwable getException()
public java.lang.String toString()
toString
in class java.lang.Throwable
public static java.lang.RuntimeException wrapIfNeeded(java.lang.Throwable ex)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |