com.codestreet.messageforge
Class RBaseRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.codestreet.messageforge.RBaseRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class RBaseRuntimeException
extends java.lang.RuntimeException

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.

Version:
@VSS_FLAG_VERSION@
Author:
Mark Pollack
See Also:
Serialized Form

Constructor Summary
RBaseRuntimeException()
          Do nothing constructor.
RBaseRuntimeException(java.lang.String message)
          Creates a new RBaseException instance with a given message string.
RBaseRuntimeException(java.lang.String message, java.lang.Object[] inserts, java.lang.Throwable rootCause)
          Create a new RBaseException instance.
RBaseRuntimeException(java.lang.String message, java.lang.Object insert, java.lang.Throwable rootCause)
          Create a new RBaseException instance.
RBaseRuntimeException(java.lang.String message, java.lang.Throwable rootCause)
          Create a new RBaseException instance.
RBaseRuntimeException(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

RBaseRuntimeException

public RBaseRuntimeException()
Do nothing constructor.


RBaseRuntimeException

public RBaseRuntimeException(java.lang.String message)
Creates a new RBaseException instance with a given message string.

Parameters:
message - a String value

RBaseRuntimeException

public RBaseRuntimeException(java.lang.Throwable rootCause)
Create an exception nesting the rootCause of this exception.

Parameters:
rootCause - a value of type 'Throwable'.

RBaseRuntimeException

public RBaseRuntimeException(java.lang.String message,
                             java.lang.Throwable rootCause)
Create a new RBaseException instance. Allows for an association of an originating exception.

Parameters:
message - Message to describe the exception
rootCause - The exceptio that caused this exception to be raised.

RBaseRuntimeException

public RBaseRuntimeException(java.lang.String message,
                             java.lang.Object[] inserts,
                             java.lang.Throwable rootCause)
Create a new RBaseException instance. Allows for an association of an originating exception.

Parameters:
message - Message to describe the exception
inserts - an Object[] value
rootCause - The exceptio that caused this exception to be raised.

RBaseRuntimeException

public RBaseRuntimeException(java.lang.String message,
                             java.lang.Object insert,
                             java.lang.Throwable rootCause)
Create a new RBaseException instance. Allows for an association of an originating exception.

Parameters:
message - Message to describe the exception
insert - an Object value
rootCause - The exceptio that caused this exception to be raised.
Method Detail

getRootCause

public java.lang.Throwable getRootCause()
Get the exception that caused this exception to be raised.

Returns:
the root exception.

getStackTraceString

public java.lang.String getStackTraceString()
Return the stack trace including root cause exceptions.

Returns:
The stack trace of the exception.

getMessage

public java.lang.String getMessage()
Override Exceptin.getMessage to include information of the root causeo of the exception.

Returns:
The exception message, including root cause messages.

toString

public java.lang.String toString()

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintStream inPrintStream)

printStackTrace

public void printStackTrace(java.io.PrintWriter inPrintWriter)

generateStackTraceString

public static java.lang.String generateStackTraceString(java.lang.Throwable t)


Copyright © 2003-2006 CodeStreet. All Rights Reserved.