org.cdmckay.coffeedom
Class CoffeeDOMException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.cdmckay.coffeedom.CoffeeDOMException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CoffeeDOMParseException, DataConversionException, XSLTransformException

public class CoffeeDOMException
extends RuntimeException

The top level exception that CoffeeDOM classes can throw. Its subclasses add specificity to the problems that can occur using CoffeeDOM. This single exception can be caught to handle all CoffeeDOM specific problems (some methods may throw IOException and such).

Author:
Brett McLaughlin, Jason Hunter
See Also:
Serialized Form

Constructor Summary
CoffeeDOMException()
          This will create an Exception.
CoffeeDOMException(String message)
          This will create an Exception with the given message.
CoffeeDOMException(String message, Throwable cause)
          This will create an Exception with the given message and wrap another Exception.
 
Method Summary
 Throwable getCause()
          This will return the root cause Throwable, or null if one does not exist.
 String getMessage()
          This returns the message for the Exception.
 Throwable initCause(Throwable cause)
          Initializes the cause of this exception to be the specified value.
 void printStackTrace()
          This prints the stack trace of the Exception.
 void printStackTrace(PrintStream s)
          Prints the stack trace of the Exception to the given PrintStream.
 void printStackTrace(PrintWriter w)
          Prints the stack trace of the Exception to the given PrintWriter.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoffeeDOMException

public CoffeeDOMException()
This will create an Exception.


CoffeeDOMException

public CoffeeDOMException(String message)
This will create an Exception with the given message.

Parameters:
message - String message indicating the problem that occurred.

CoffeeDOMException

public CoffeeDOMException(String message,
                          Throwable cause)
This will create an Exception with the given message and wrap another Exception. This is useful when the originating Exception should be held on to.

Parameters:
message - String message indicating the problem that occurred.
cause - Throwable that caused this to be thrown.
Method Detail

initCause

public Throwable initCause(Throwable cause)
Initializes the cause of this exception to be the specified value.

Overrides:
initCause in class Throwable
Parameters:
cause - Throwable that caused this to be thrown.
Returns:
a pointer to this throwable

getMessage

public String getMessage()
This returns the message for the Exception. If there are one or more nested exceptions, their messages are appended.

Overrides:
getMessage in class Throwable
Returns:
String - message for Exception.

printStackTrace

public void printStackTrace()
This prints the stack trace of the Exception. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Prints the stack trace of the Exception to the given PrintStream. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to print to

printStackTrace

public void printStackTrace(PrintWriter w)
Prints the stack trace of the Exception to the given PrintWriter. If there is a root cause, the stack trace of the root Exception is printed right after.

Overrides:
printStackTrace in class Throwable
Parameters:
w - PrintWriter to print to

getCause

public Throwable getCause()
This will return the root cause Throwable, or null if one does not exist.

Overrides:
getCause in class Throwable
Returns:
Throwable - the wrapped Throwable.


Copyright © 2011. All Rights Reserved.