org.objectweb.jac.util
Class WrappedThrowableException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--org.objectweb.jac.util.WrappedThrowableException
All Implemented Interfaces:
Serializable

public class WrappedThrowableException
extends RuntimeException

This runtime exeption wraps a regular exception so that JAC objects can also send non-runtime exceptions.

Author:
Renaud Pawlak
See Also:
Serialized Form

Constructor Summary
WrappedThrowableException(Throwable wrappedThrowable)
          Creates the wrapping exception.
 
Method Summary
 Throwable getCause()
           
 String getLocalizedMessage()
           
 String getMessage()
          Returns the error message string of the wrapped throwable object.
 Throwable getWrappedThrowable()
          Gets the wrapped throwable.
 void printStackTrace()
          Prints the stack trace that has been filled when the exception was created.
 void printStackTrace(PrintStream s)
          Prints the wrapped throwable and its backtrace to the specified print stream.
 void printStackTrace(PrintWriter s)
          Prints the wrapped throwable and its backtrace to the specified print writer.
 String toString()
          Returns the string depicting the exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedThrowableException

public WrappedThrowableException(Throwable wrappedThrowable)
Creates the wrapping exception.

Parameters:
wrappedThrowable - the throwable that is wrapped by this exception
Method Detail

getWrappedThrowable

public Throwable getWrappedThrowable()
Gets the wrapped throwable.

Returns:
the wrapped throwable

toString

public String toString()
Returns the string depicting the exception. It is the message of the wrapped throwable.

Overrides:
toString in class Throwable
Returns:
the printable representation of the wrapped exception

printStackTrace

public void printStackTrace()
Prints the stack trace that has been filled when the exception was created.

This method delegates to the wrapped throwable.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Prints the wrapped throwable and its backtrace to the specified print stream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - the stream

printStackTrace

public void printStackTrace(PrintWriter s)
Prints the wrapped throwable and its backtrace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
s - the writer

getMessage

public String getMessage()
Returns the error message string of the wrapped throwable object.

Overrides:
getMessage in class Throwable
Returns:
the error message string

getLocalizedMessage

public String getLocalizedMessage()
Overrides:
getLocalizedMessage in class Throwable

getCause

public Throwable getCause()
Overrides:
getCause in class Throwable