avignon
Class AvignonRuntimeExceptionContainer

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byavignon.AvignonRuntimeExceptionContainer
All Implemented Interfaces:
java.io.Serializable

public class AvignonRuntimeExceptionContainer
extends java.lang.RuntimeException

This class is used to convert caught exceptions into RuntimeExceptions that are then monitored by Avignon and included in the error output.

See Also:
Serialized Form

Constructor Summary
AvignonRuntimeExceptionContainer(java.lang.Throwable exception)
          Converts the given exception into a runtime exception while preserving its stack trace.
AvignonRuntimeExceptionContainer(java.lang.Throwable exception, java.lang.String additionalMessage)
          Converts the given exception into a runtime exception while preserving its stack trace.
 
Method Summary
 java.lang.Throwable getException()
          Returns the original exception that was used in construction.
 java.lang.String getMessage()
          Returns the message of the original exception with the addition message appended.
 void printStackTrace()
          Prints the addition message to the standard output followed by the stack trace of the original exception.
 void printStackTrace(java.io.PrintStream output)
          Prints the addition to 'output' followed by the stack trace of the original exception.
 void printStackTrace(java.io.PrintWriter output)
          Prints the addition to 'output' followed by the stack trace of the original exception.
 
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
 

Constructor Detail

AvignonRuntimeExceptionContainer

public AvignonRuntimeExceptionContainer(java.lang.Throwable exception)
Converts the given exception into a runtime exception while preserving its stack trace. No addition message is added to the exception.

Parameters:
exception - Checked exception to mask as an unchecked exception.

AvignonRuntimeExceptionContainer

public AvignonRuntimeExceptionContainer(java.lang.Throwable exception,
                                        java.lang.String additionalMessage)
Converts the given exception into a runtime exception while preserving its stack trace. The addition message will be prepended to any stack traces and appended in any calls to getMessage().

Parameters:
exception - Checked exception to mask as an unchecked exception.
additionalMessage - Extra information to display with the actual exception's message.
Method Detail

getException

public java.lang.Throwable getException()
Returns the original exception that was used in construction.

Returns:
The original checked exception.

getMessage

public java.lang.String getMessage()
Returns the message of the original exception with the addition message appended.

Returns:
The message of the original exception and any additional message passed to the AvignonRuntimeExceptionContainer's constructor.

printStackTrace

public void printStackTrace()
Prints the addition message to the standard output followed by the stack trace of the original exception.


printStackTrace

public void printStackTrace(java.io.PrintStream output)
Prints the addition to 'output' followed by the stack trace of the original exception.

Parameters:
output - PrintStream to which to print the stack trace.

printStackTrace

public void printStackTrace(java.io.PrintWriter output)
Prints the addition to 'output' followed by the stack trace of the original exception.

Parameters:
output - PrintWriter to which to print the stack trace.

SourceForge.net Logo