Package org.jdom
Class JDOMException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.jdom.JDOMException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DataConversionException,JDOMParseException,XSLTransformException
public class JDOMException extends java.lang.ExceptionThe 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 throwIOExceptionand such).- Version:
- $Revision: 1.26 $, $Date: 2008/12/10 00:59:51 $
- Author:
- Brett McLaughlin, Jason Hunter
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JDOMException()This will create anException.JDOMException(java.lang.String message)This will create anExceptionwith the given message.JDOMException(java.lang.String message, java.lang.Throwable cause)This will create anExceptionwith the given message and wrap anotherException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ThrowablegetCause()This will return the root causeThrowable, or null if one does not exist.java.lang.StringgetMessage()This returns the message for theException.java.lang.ThrowableinitCause(java.lang.Throwable cause)Intializes the cause of this exception to be the specified value.voidprintStackTrace()This prints the stack trace of theException.voidprintStackTrace(java.io.PrintStream s)Prints the stack trace of theExceptionto the given PrintStream.voidprintStackTrace(java.io.PrintWriter w)Prints the stack trace of theExceptionto the given PrintWriter.
-
-
-
Constructor Detail
-
JDOMException
public JDOMException()
This will create anException.
-
JDOMException
public JDOMException(java.lang.String message)
This will create anExceptionwith the given message.- Parameters:
message-Stringmessage indicating the problem that occurred.
-
JDOMException
public JDOMException(java.lang.String message, java.lang.Throwable cause)This will create anExceptionwith the given message and wrap anotherException. This is useful when the originatingExceptionshould be held on to.- Parameters:
message-Stringmessage indicating the problem that occurred.cause-Throwablethat caused this to be thrown.
-
-
Method Detail
-
initCause
public java.lang.Throwable initCause(java.lang.Throwable cause)
Intializes the cause of this exception to be the specified value.- Overrides:
initCausein classjava.lang.Throwable- Parameters:
cause-Throwablethat caused this to be thrown.- Returns:
- a pointer to this throwable
-
getMessage
public java.lang.String getMessage()
This returns the message for theException. If there are one or more nested exceptions, their messages are appended.- Overrides:
getMessagein classjava.lang.Throwable- 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 rootExceptionis printed right after.- Overrides:
printStackTracein classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints the stack trace of theExceptionto the given PrintStream. If there is a root cause, the stack trace of the rootExceptionis printed right after.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s- PrintStream to print to
-
printStackTrace
public void printStackTrace(java.io.PrintWriter w)
Prints the stack trace of theExceptionto the given PrintWriter. If there is a root cause, the stack trace of the rootExceptionis printed right after.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
w- PrintWriter to print to
-
getCause
public java.lang.Throwable getCause()
This will return the root causeThrowable, or null if one does not exist.- Overrides:
getCausein classjava.lang.Throwable- Returns:
Throwable- the wrappedThrowable.
-
-