jade.util
Class WrapperException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--jade.util.WrapperException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Codec.CodecException, OntologyException, ProfileException

public abstract class WrapperException
extends java.lang.Exception

This class acts as a base class for all the exceptions that wrap another (nested) exception. The typical usage for descendents of this class is to throw them within the catch block for their nested exception.

Version:
$Date: 2005-04-29 18:18:18 +0200 (Fri, 29 Apr 2005) $ $Revision: 5686 $
Author:
Giovanni Rimassa - Universita' di Parma
See Also:
Serialized Form

Constructor Summary
protected WrapperException(java.lang.String m)
          Create a wrapper exception with the given message.
protected WrapperException(java.lang.String m, java.lang.Throwable t)
          Create a wrapper exception with the given message and nested exception.
 
Method Summary
 java.lang.String getMessage()
          Retrieve the exception message text.
 java.lang.Throwable getNested()
          Reads the exception wrapped by this object.
 void printStackTrace()
          Prints the stack trace of this exception on the standard output stream.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrapperException

protected WrapperException(java.lang.String m,
                           java.lang.Throwable t)
Create a wrapper exception with the given message and nested exception.

Parameters:
m - The exception message text.
t - The nested exception that caused this one.

WrapperException

protected WrapperException(java.lang.String m)
Create a wrapper exception with the given message.

Parameters:
m - The exception message text.
Method Detail

getMessage

public java.lang.String getMessage()
Retrieve the exception message text.

Overrides:
getMessage in class java.lang.Throwable
Returns:
The exception message, including the nested exception text if present.

printStackTrace

public void printStackTrace()
Prints the stack trace of this exception on the standard output stream. If a nested exception is present, its stack trace is also printed.

Overrides:
printStackTrace in class java.lang.Throwable

getNested

public java.lang.Throwable getNested()
Reads the exception wrapped by this object.

Returns:
the Throwable object that is the exception that was originally thrown.


JADE