com.ibm.commons.util
Class AbstractException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.ibm.commons.util.AbstractException
All Implemented Interfaces:
IExceptionEx, java.io.Serializable
Direct Known Subclasses:
JsonException, LogException

public class AbstractException
extends java.lang.Exception
implements IExceptionEx

Abstract base class for global exceptions. This class is the main class for all the exception. It provides several enhancements to the Java Exception clas, by providing message formating with parameters. All its constructors also have a first argument which is the root exception, which is an easy way for implementing the "exception chaining" pattern.

See Also:
Serialized Form

Constructor Summary
AbstractException(java.lang.Throwable nextException)
          Create a new exception.
AbstractException(java.lang.Throwable nextException, java.lang.String msg, java.lang.Object... params)
          Create a new exception.
 
Method Summary
static java.lang.Throwable getCause(java.lang.Throwable ext)
          Get the exception cause.
static java.lang.Throwable initCause(java.lang.Throwable ext, java.lang.Throwable cause)
          Init the exception cause.
 void printExtraInformation(java.io.PrintWriter err)
          Print some extra information.
static void printExtraInformation(java.io.PrintWriter err, java.lang.Throwable ex)
          Extended stack trace print
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractException

public AbstractException(java.lang.Throwable nextException)
Create a new exception. The exception is not featuring a message

Parameters:
nextException - the cause exception

AbstractException

public AbstractException(java.lang.Throwable nextException,
                         java.lang.String msg,
                         java.lang.Object... params)
Create a new exception. The message is formatted using the StringUtil.format rules.

Parameters:
nextException - the cause exception
msg - the exception message
Method Detail

initCause

public static java.lang.Throwable initCause(java.lang.Throwable ext,
                                            java.lang.Throwable cause)
Init the exception cause. The message is formatted using the StringUtil.format rules.

Parameters:
nextException - the cause exception
msg - the exception message

getCause

public static java.lang.Throwable getCause(java.lang.Throwable ext)
Get the exception cause. The message is formatted using the StringUtil.format rules.

Parameters:
nextException - the cause exception
msg - the exception message

printExtraInformation

public void printExtraInformation(java.io.PrintWriter err)
Print some extra information.

Specified by:
printExtraInformation in interface IExceptionEx
Parameters:
err -

printExtraInformation

public static void printExtraInformation(java.io.PrintWriter err,
                                         java.lang.Throwable ex)
Extended stack trace print

Parameters:
err -