|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.bowstreet.util.WrappedException
public class WrappedException
Class for creating a RuntimeException wrapper from any Throwable exceptions. This can be used to re-throw non-runtime exceptions. If constructed with target exception the printStackTrace(..), getMessage() and toString() methods will use the target exception to produce their results.
Constructor Summary | |
---|---|
WrappedException(java.lang.String msg)
Constructs a WrappedException with a message. |
|
WrappedException(java.lang.Throwable target)
Constructs a WrappedException with a target exception. |
|
WrappedException(java.lang.Throwable target,
java.lang.String msg)
Constructs a WrappedException with a target exception and a detail message. |
Method Summary | |
---|---|
java.lang.String |
getMessage()
Returns the error message string of this throwable object. |
java.lang.Object |
getProperty(java.lang.String key)
Gets a property given the key. |
java.lang.Throwable |
getTargetException()
Gets the thrown target exception. |
void |
printStackTrace()
Prints the stack trace of the thrown target exception. |
void |
printStackTrace(java.io.PrintStream ps)
Prints the stack trace of the thrown target exception to the specified print stream. |
void |
printStackTrace(java.io.PrintWriter pw)
Prints the stack trace of the thrown target exception to the specified print writer. |
void |
putProperty(java.lang.String key,
java.lang.Object value)
Sets the specified property. |
java.lang.String |
toString()
Returns a short description of this throwable object. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WrappedException(java.lang.String msg)
msg
- The message for the exception.public WrappedException(java.lang.Throwable target)
target
- The real execption.public WrappedException(java.lang.Throwable target, java.lang.String msg)
target
- The real execption.msg
- The message for the exception.Method Detail |
---|
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.Object getProperty(java.lang.String key)
key
- Specifies the property to get.
public java.lang.Throwable getTargetException()
public void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream ps)
printStackTrace
in class java.lang.Throwable
ps
- Specifies the PrintStream to print the stack trace to.public void printStackTrace(java.io.PrintWriter pw)
printStackTrace
in class java.lang.Throwable
pw
- Specifies the PrintWriter to print the stack trace to.public void putProperty(java.lang.String key, java.lang.Object value)
key
- Specifies the property to store.value
- Specifies the value to store.public java.lang.String toString()
toString
in class java.lang.Throwable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |