Package org.jdom
Class JDOMException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jdom.JDOMException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DataConversionException
,JDOMParseException
,XSLTransformException
The top level exception that JDOM classes can throw. Its subclasses add
specificity to the problems that can occur using JDOM. This single exception
can be caught to handle all JDOM specific problems (some methods may throw
IOException
and such).- Version:
- $Revision: 1.26 $, $Date: 2008/12/10 00:59:51 $
- Author:
- Brett McLaughlin, Jason Hunter
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionThis will create anException
.JDOMException
(String message) This will create anException
with the given message.JDOMException
(String message, Throwable cause) This will create anException
with the given message and wrap anotherException
. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
This will return the root causeThrowable
, or null if one does not exist.This returns the message for theException
.Intializes the cause of this exception to be the specified value.void
This prints the stack trace of theException
.void
Prints the stack trace of theException
to the given PrintStream.void
Prints the stack trace of theException
to the given PrintWriter.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, setStackTrace, toString
-
Constructor Details
-
JDOMException
public JDOMException()This will create anException
. -
JDOMException
This will create anException
with the given message.- Parameters:
message
-String
message indicating the problem that occurred.
-
JDOMException
This will create anException
with the given message and wrap anotherException
. This is useful when the originatingException
should be held on to.- Parameters:
message
-String
message indicating the problem that occurred.cause
-Throwable
that caused this to be thrown.
-
-
Method Details
-
initCause
Intializes the cause of this exception to be the specified value. -
getMessage
This returns the message for theException
. If there are one or more nested exceptions, their messages are appended.- Overrides:
getMessage
in classThrowable
- Returns:
String
- message forException
.
-
printStackTrace
public void printStackTrace()This prints the stack trace of theException
. If there is a root cause, the stack trace of the rootException
is printed right after.- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
Prints the stack trace of theException
to the given PrintStream. If there is a root cause, the stack trace of the rootException
is printed right after.- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
- PrintStream to print to
-
printStackTrace
Prints the stack trace of theException
to the given PrintWriter. If there is a root cause, the stack trace of the rootException
is printed right after.- Overrides:
printStackTrace
in classThrowable
- Parameters:
w
- PrintWriter to print to
-
getCause
This will return the root causeThrowable
, or null if one does not exist.
-