com.waveset.util
Class RuntimeExceptionWrapper

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.waveset.util.RuntimeExceptionWrapper
All Implemented Interfaces:
java.io.Serializable

public class RuntimeExceptionWrapper
extends java.lang.RuntimeException

For wrapping exceptions as a RuntimeException. Nice for those cases where you are calling an API which declares that it throws an exception which cannot happen in the current context. (Won't be needed anymore in JDK 1.4 since it's RuntimeException constructor takes an optional cause).

See Also:
Serialized Form

Field Summary
static java.lang.String code_id
           
 
Constructor Summary
RuntimeExceptionWrapper()
          Construct a RuntimeExceptionWrapper with no message or nested throwable.
RuntimeExceptionWrapper(java.lang.String message)
          Construct a new RuntimeExceptionWrapper with a detailed message.
RuntimeExceptionWrapper(java.lang.String message, java.lang.Throwable e)
          Create a new RuntimeExceptionWrapper from an existing exception.
RuntimeExceptionWrapper(java.lang.Throwable e)
          Construct a new RuntimeExceptionWrapper wrapping an existing exception.
 
Method Summary
 java.lang.Throwable getCause()
          Returns the root exception.
 java.lang.String getLocalizedMessage()
          Return a localized message for this exception.
 java.lang.String getMessage()
          Return a detail message for this exception.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream str)
           
 void printStackTrace(java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

RuntimeExceptionWrapper

public RuntimeExceptionWrapper()
Construct a RuntimeExceptionWrapper with no message or nested throwable.


RuntimeExceptionWrapper

public RuntimeExceptionWrapper(java.lang.String message)
Construct a new RuntimeExceptionWrapper with a detailed message.


RuntimeExceptionWrapper

public RuntimeExceptionWrapper(java.lang.Throwable e)
Construct a new RuntimeExceptionWrapper wrapping an existing exception.

The existing exception will be embedded in the new one, and its message will become the default message for the ExceptionWrapper.


RuntimeExceptionWrapper

public RuntimeExceptionWrapper(java.lang.String message,
                               java.lang.Throwable e)
Create a new RuntimeExceptionWrapper from an existing exception.

The existing exception will be embedded in the new one, but the new exception will have its own message.

Method Detail

getCause

public java.lang.Throwable getCause()
Returns the root exception.


getMessage

public java.lang.String getMessage()
Return a detail message for this exception.

If there is a embedded exception, and if this exception has no detail message of its own, getMessage method will return the detail message from the first embedded exception.


getLocalizedMessage

public java.lang.String getLocalizedMessage()
Return a localized message for this exception.

If there is a embedded exception, uses the embedded exception's localized message. Othermise returns super.getLocalizedMessage.


printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintStream str)

printStackTrace

public void printStackTrace(java.io.PrintWriter out)