com.waveset.util
Class ExceptionWrapper

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.waveset.util.ExceptionWrapper
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
WavesetException

public class ExceptionWrapper
extends java.lang.Exception

An exception class that can wrap other exceptions.

See Also:
Serialized Form

Field Summary
static java.lang.String code_id
           
 
Constructor Summary
ExceptionWrapper()
          Construct a ExceptionWrapper with no message or nested throwable.
ExceptionWrapper(java.lang.String message)
          Construct a new ExceptionWrapper with a detailed message.
ExceptionWrapper(java.lang.String message, java.lang.Throwable e)
          Create a new ExceptionWrapper from an existing exception.
ExceptionWrapper(java.lang.Throwable e)
          Construct a new ExceptionWrapper wrapping an existing exception.
 
Method Summary
 void addException(java.lang.Throwable e)
          Adds an Exception to the list of wrapped Exceptions.
 int clearExceptions()
          Removes all wrapped Exceptions.
static java.lang.String describeException(java.lang.Throwable e)
           
 java.lang.String getAllMessages()
          Return a string containing the exception class name and messages for all wrapped exceptions.
 java.lang.Throwable getException()
          Returns the first embedded exception, if any.
 java.lang.Throwable getException(int n)
          Returns the Nth embedded exception, if any.
 int getExceptionCount()
          Returns the number of wrapped Exceptions.
 java.lang.String getMessage()
          Return a detail message for this exception.
 boolean hasException()
          Returns true if there are any wrapped Exceptions.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream str)
           
 void printStackTrace(java.io.PrintWriter out)
           
 int removeException(java.lang.Throwable e)
          Removes an Exception to the list of wrapped Exceptions.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

ExceptionWrapper

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


ExceptionWrapper

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


ExceptionWrapper

public ExceptionWrapper(java.lang.Throwable e)
Construct a new ExceptionWrapper 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.


ExceptionWrapper

public ExceptionWrapper(java.lang.String message,
                        java.lang.Throwable e)
Create a new ExceptionWrapper 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

getExceptionCount

public int getExceptionCount()
Returns the number of wrapped Exceptions.


hasException

public boolean hasException()
Returns true if there are any wrapped Exceptions.


getException

public java.lang.Throwable getException()
Returns the first embedded exception, if any.


getException

public java.lang.Throwable getException(int n)
Returns the Nth embedded exception, if any.


addException

public void addException(java.lang.Throwable e)
Adds an Exception to the list of wrapped Exceptions.


removeException

public int removeException(java.lang.Throwable e)
Removes an Exception to the list of wrapped Exceptions.


clearExceptions

public int clearExceptions()
Removes all wrapped Exceptions.


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.


getAllMessages

public java.lang.String getAllMessages()
Return a string containing the exception class name and messages for all wrapped exceptions.

I18N: There is English in here, be careful.

In current practice this should not be called, rendering of wrapped exceptions is now handled by WavesetException.


describeException

public static java.lang.String describeException(java.lang.Throwable e)

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(java.io.PrintStream str)

printStackTrace

public void printStackTrace(java.io.PrintWriter out)