|
||||||||||
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 com.codestreet.messageforge.RBaseException
The BaseException class is used across all core services. It allows you to set a message with an exception, much like the normal java.lang.Exception class but in addition you can also carry along an original exception if you want. This is incorportated in the output from getMessage and toString(). The previous version of this class used to check if the string passed in was part of the MessageCatalog and if so, then use the associated key in creating the exception message. Various constructors were also provided to do string replacement on the exception message. This functionality is now removed. It is the responsibility of the creator of the exception to lookup message text directly from the MessageCatalog and pass it to the constructor of the exception. Implementation inspired from various placed, most recently Javaworld, Javatips #91. Java 1.4 now has this functionality.
Constructor Summary | |
RBaseException()
Do nothing constructor. |
|
RBaseException(java.lang.String message)
Creates a new RBaseException instance with a given message string. |
|
RBaseException(java.lang.String message,
java.lang.Object[] inserts,
java.lang.Throwable rootCause)
Create a new RBaseException instance. |
|
RBaseException(java.lang.String message,
java.lang.Object insert,
java.lang.Throwable rootCause)
Create a new RBaseException instance. |
|
RBaseException(java.lang.String message,
java.lang.Throwable rootCause)
Create a new RBaseException instance. |
|
RBaseException(java.lang.Throwable rootCause)
Create an exception nesting the rootCause of this exception. |
Method Summary | |
static java.lang.String |
generateStackTraceString(java.lang.Throwable t)
|
java.lang.String |
getMessage()
Override Exceptin.getMessage to include information of the root causeo of the exception. |
java.lang.Throwable |
getRootCause()
Get the exception that caused this exception to be raised. |
java.lang.String |
getStackTraceString()
Return the stack trace including root cause exceptions. |
void |
printStackTrace()
|
void |
printStackTrace(java.io.PrintStream inPrintStream)
|
void |
printStackTrace(java.io.PrintWriter inPrintWriter)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RBaseException()
public RBaseException(java.lang.String message)
message
- a String valuepublic RBaseException(java.lang.Throwable rootCause)
rootCause
- a value of type 'Throwable'.public RBaseException(java.lang.String message, java.lang.Throwable rootCause)
message
- Message to describe the exceptionrootCause
- The exceptio that caused this exception to be raised.public RBaseException(java.lang.String message, java.lang.Object[] inserts, java.lang.Throwable rootCause)
message
- Message to describe the exceptioninserts
- an Object[] valuerootCause
- The exceptio that caused this exception to be raised.public RBaseException(java.lang.String message, java.lang.Object insert, java.lang.Throwable rootCause)
message
- Message to describe the exceptioninsert
- an Object valuerootCause
- The exceptio that caused this exception to be raised.Method Detail |
public java.lang.Throwable getRootCause()
public java.lang.String getStackTraceString()
public java.lang.String getMessage()
public java.lang.String toString()
public void printStackTrace()
public void printStackTrace(java.io.PrintStream inPrintStream)
public void printStackTrace(java.io.PrintWriter inPrintWriter)
public static java.lang.String generateStackTraceString(java.lang.Throwable t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |