org.koala.koalautil
Class ChainedException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.koala.koalautil.ChainedException
All Implemented Interfaces:
java.io.Serializable

public class ChainedException
extends java.lang.Exception

provides many useful ways to raise exceptions with different sets of information

See Also:
Serialized Form

Constructor Summary
ChainedException()
          Default constructor
ChainedException(java.lang.Object className, java.lang.String description, java.lang.String method)
          Creates a new ChainedException with some additional information on the context of the exception
ChainedException(java.lang.Object className, java.lang.String description, java.lang.String method, java.lang.Throwable cause)
          Creates a new ChainedException with some additional information on the context of the exception
ChainedException(java.lang.String msg)
          Creates new ChainedException with a given message
ChainedException(java.lang.String className, java.lang.String description, java.lang.String method)
          Creates a new ChainedException with some additional information on the context of the exception
ChainedException(java.lang.String className, java.lang.String description, java.lang.String method, java.lang.Throwable cause)
          Creates a new ChainedException with some additional information on the context of the exception
ChainedException(java.lang.String msg, java.lang.Throwable cause)
          Creates a new ChainedException providing a message and a cause
 
Method Summary
 java.lang.String getClassName()
          returns the name of the class which raised the exception
 java.lang.String getMessage()
          returns the exception's message
 java.lang.String getMethod()
          returns the name of the method which raised the exception
 java.lang.String getStackTraceAsString()
          returns the exception's stack trace in a String
 void printStackTrace()
          prints the stack trace with some additional formatting
 void printStackTrace(java.io.PrintStream ps)
          prints the stack trace with some additional formatting to a given stream
 void printStackTrace(java.io.PrintWriter pw)
          prints the stack trace with some additional formatting using a writer
 
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

ChainedException

public ChainedException()
Default constructor


ChainedException

public ChainedException(java.lang.String msg)
Creates new ChainedException with a given message

Parameters:
msg - the message to include in the raised exception

ChainedException

public ChainedException(java.lang.String msg,
                        java.lang.Throwable cause)
Creates a new ChainedException providing a message and a cause

Parameters:
msg - the message to include in the exception
cause - the cause of the exception

ChainedException

public ChainedException(java.lang.String className,
                        java.lang.String description,
                        java.lang.String method)
Creates a new ChainedException with some additional information on the context of the exception

Parameters:
className - the name of the class which raised the exception
description - the description of the exception
method - the name of the method which raise the exception

ChainedException

public ChainedException(java.lang.String className,
                        java.lang.String description,
                        java.lang.String method,
                        java.lang.Throwable cause)
Creates a new ChainedException with some additional information on the context of the exception

Parameters:
className - the name of the class which raised the exception
description - the description of the exception
method - the name of the method which raised the exception
cause - the cause of the exception

ChainedException

public ChainedException(java.lang.Object className,
                        java.lang.String description,
                        java.lang.String method)
Creates a new ChainedException with some additional information on the context of the exception

Parameters:
className - the object from which to obtain the name of the class which raised the exception
description - the description of the exception
method - the name of the method which raised the exception

ChainedException

public ChainedException(java.lang.Object className,
                        java.lang.String description,
                        java.lang.String method,
                        java.lang.Throwable cause)
Creates a new ChainedException with some additional information on the context of the exception

Parameters:
className - the object from which to obtain the name of the class which raised the exception
description - the exception's description
method - the name of the method which raised the exception
cause - the exception's cause
Method Detail

getMessage

public java.lang.String getMessage()
returns the exception's message

Overrides:
getMessage in class java.lang.Throwable
Returns:
message

getClassName

public java.lang.String getClassName()
returns the name of the class which raised the exception

Returns:
className

getMethod

public java.lang.String getMethod()
returns the name of the method which raised the exception

Returns:
method

printStackTrace

public void printStackTrace()
prints the stack trace with some additional formatting

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
prints the stack trace with some additional formatting to a given stream

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
ps - the stream to print the stack trace to

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
prints the stack trace with some additional formatting using a writer

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
pw - the writer to use

getStackTraceAsString

public java.lang.String getStackTraceAsString()
returns the exception's stack trace in a String

Returns:
the exception's stack trace