attrib4j
Class AttributeException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--attrib4j.AttributeException
All Implemented Interfaces:
java.io.Serializable

public class AttributeException
extends java.lang.Exception

It allows you nest exceptions. This results in simplifing the external API of a package or library. Implementation inspired from various placed, most recently Javaworld, Javatips #91. Now included as part of J2SE 1.4

Version:
$Revision: 1.4 $ $Date: 2003/03/22 17:56:20 $
Author:
Mark Pollack
See Also:
Serialized Form

Constructor Summary
AttributeException()
          Do nothing constructor.
AttributeException(java.lang.String message)
          Creates a new AttributeException instance.
AttributeException(java.lang.String message, java.lang.Throwable rootCause)
          Create a new AttributeException instance.
AttributeException(java.lang.Throwable rootCause)
          Create an exception nesting the rootCause of this exception.
 
Method Summary
 java.lang.String getMessage()
          Override Exceptipn.getMessage to include information of the root cause of the exception.
 java.lang.Throwable getRootCause()
          Get the exception that caused this exception to be raised.
 java.lang.String getStackTraceString()
          Return the stack trace including root cause exceptions.
 void printStackTrace()
          Override default behavior
 void printStackTrace(java.io.PrintStream inPrintStream)
          Override default behavior
 void printStackTrace(java.io.PrintWriter inPrintWriter)
          Override default behavior
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeException

public AttributeException()
Do nothing constructor.


AttributeException

public AttributeException(java.lang.String message)
Creates a new AttributeException instance.

Parameters:
message - a String value

AttributeException

public AttributeException(java.lang.Throwable rootCause)
Create an exception nesting the rootCause of this exception.

Parameters:
rootCause - a value of type 'Throwable'.

AttributeException

public AttributeException(java.lang.String message,
                          java.lang.Throwable rootCause)
Create a new AttributeException instance. Allows for an association of an originating exception.

Parameters:
message - Message of the exception. message of the exception.
rootCause - The exception that caused this exception to be raised.
Method Detail

getRootCause

public java.lang.Throwable getRootCause()
Get the exception that caused this exception to be raised.

Returns:
the root exception.

getStackTraceString

public java.lang.String getStackTraceString()
Return the stack trace including root cause exceptions.

Returns:
The stack trace of the exception.

getMessage

public java.lang.String getMessage()
Override Exceptipn.getMessage to include information of the root cause of the exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
The exception message, including root cause messages.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Override default behavior

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream inPrintStream)
Override default behavior

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter inPrintWriter)
Override default behavior

Overrides:
printStackTrace in class java.lang.Throwable


Copyright © 2002-2003 Mark Pollack. All Rights Reserved.