Top Description Fields Constructors Methods
org.jdom

public Class JDOMException

extends Exception
Class Inheritance
Known Direct Subclasses
org.jdom.input.JDOMParseException, org.jdom.transform.XSLTransformException, org.jdom.DataConversionException
Imports
java.io.*, java.lang.reflect.*, java.sql.*, org.xml.sax.*

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 java.io.IOException and such).
Authors
Brett McLaughlin, Jason Hunter
Version
$Revision: 1.26 $, $Date: 2008/12/10 00:59:51 $

Field Summary

Modifier and TypeField and Description
private Throwable
cause

Hides java.lang.Throwable.cause.

A wrapped Throwable
private static final String

Constructor Summary

AccessConstructor and Description
public
JDOMException()

This will create an Exception.

public
JDOMException(String
String message indicating the problem that occurred.
message
)

This will create an Exception with the given message.

public
JDOMException(String
String message indicating the problem that occurred.
message
,
Throwable
Throwable that caused this to be thrown.
cause
)

This will create an Exception with the given message and wrap another Exception.

Method Summary

Modifier and TypeMethod and Description
public Throwable

Returns:

Throwable - the wrapped Throwable.
getCause
()

Overrides java.lang.Throwable.getCause.

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

Returns:

String - message for Exception.
getMessage
()

Overrides java.lang.Throwable.getMessage.

This returns the message for the Exception.
private static Throwable
private static Throwable
getNestedException(Throwable parent, String className, String methodName)

private static Throwable
getNestedExceptionFromField(Throwable parent, String className, String fieldName)

public Throwable

Returns:

a pointer to this throwable
initCause
(Throwable
Throwable that caused this to be thrown.
cause
)

Overrides java.lang.Throwable.initCause.

Intializes the cause of this exception to be the specified value.
public void
printStackTrace()

Overrides java.lang.Throwable.printStackTrace.

This prints the stack trace of the Exception.
public void
printStackTrace(PrintStream
PrintStream to print to
s
)

Overrides java.lang.Throwable.printStackTrace.

Prints the stack trace of the Exception to the given PrintStream.
public void
printStackTrace(PrintWriter
PrintWriter to print to
w
)

Overrides java.lang.Throwable.printStackTrace.

Prints the stack trace of the Exception to the given PrintWriter.

Field Detail

causeback to summary
private Throwable cause

Hides java.lang.Throwable.cause.

A wrapped Throwable

CVS_IDback to summary
private static final String CVS_ID

Constructor Detail

JDOMExceptionback to summary
public JDOMException()

This will create an Exception.

JDOMExceptionback to summary
public JDOMException(String message)

This will create an Exception with the given message.

Parameters
message:String

String message indicating the problem that occurred.

JDOMExceptionback to summary
public JDOMException(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

String message indicating the problem that occurred.

cause:Throwable

Throwable that caused this to be thrown.

Method Detail

getCauseback to summary
public Throwable getCause()

Overrides java.lang.Throwable.getCause.

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

Returns:Throwable

Throwable - the wrapped Throwable.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

This returns the message for the Exception. If there are one or more nested exceptions, their messages are appended.

Returns:String

String - message for Exception.

getNestedExceptionback to summary
private static Throwable getNestedException(Throwable parent)
getNestedExceptionback to summary
private static Throwable getNestedException(Throwable parent, String className, String methodName)
getNestedExceptionFromFieldback to summary
private static Throwable getNestedExceptionFromField(Throwable parent, String className, String fieldName)
initCauseback to summary
public Throwable initCause(Throwable cause)

Overrides java.lang.Throwable.initCause.

Intializes the cause of this exception to be the specified value.

Parameters
cause:Throwable

Throwable that caused this to be thrown.

Returns:Throwable

a pointer to this throwable

printStackTraceback to summary
public void printStackTrace()

Overrides java.lang.Throwable.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.

printStackTraceback to summary
public void printStackTrace(PrintStream s)

Overrides java.lang.Throwable.printStackTrace.

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.

Parameters
s:PrintStream

PrintStream to print to

printStackTraceback to summary
public void printStackTrace(PrintWriter w)

Overrides java.lang.Throwable.printStackTrace.

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.

Parameters
w:PrintWriter

PrintWriter to print to