Class JDOException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.sun.jdo.api.persistence.support.JDOException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JDOCanRetryException
,JDOFatalException
public class JDOException extends RuntimeException
This is the root of all JDO Exceptions. It contains an optional nested Exception and an optional message.- Version:
- 0.1
- Author:
- Craig Russell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JDOException()
Creates a newJDOException
without detail message.JDOException(String msg)
Constructs a newJDOException
with the specified detail message.JDOException(String msg, Exception nested)
Constructs a newJDOException
with the specified detail message and nested Exception.JDOException(String msg, Exception nested, Object[] failed)
Constructs a newJDOException
with the specified detail message, nested exception, and failed object array.JDOException(String msg, Object[] failed)
Constructs a newJDOException
with the specified detail message and failed object array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFailedObject(Object o)
The exception may need to add objects to an array of failed objects.Object[]
getFailedObjectArray()
The exception may include an array of failed objects.Exception
getNestedException()
The exception may have been caused by an Exception in the runtime.void
printStackTrace()
Prints thisJDOException
and its backtrace to the standard error output.void
printStackTrace(PrintStream s)
Prints thisJDOException
and its backtrace to the specified print stream.void
printStackTrace(PrintWriter s)
Prints thisJDOException
and its backtrace to the specified print writer.String
toString()
The String representation includes the name of the class, the descriptive comment (if any), the String representation of the nested Exception (if any), and the String representation of the failed Object array (if any).-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
-
-
-
Constructor Detail
-
JDOException
public JDOException()
Creates a newJDOException
without detail message.
-
JDOException
public JDOException(String msg)
Constructs a newJDOException
with the specified detail message.- Parameters:
msg
- the detail message.
-
JDOException
public JDOException(String msg, Exception nested)
Constructs a newJDOException
with the specified detail message and nested Exception.- Parameters:
msg
- the detail message.nested
- the nestedException
.
-
JDOException
public JDOException(String msg, Object[] failed)
Constructs a newJDOException
with the specified detail message and failed object array.- Parameters:
msg
- the detail message.failed
- the failed object array.
-
-
Method Detail
-
addFailedObject
public void addFailedObject(Object o)
The exception may need to add objects to an array of failed objects.- Parameters:
o
- the failed object to add to an array.
-
getFailedObjectArray
public Object[] getFailedObjectArray()
The exception may include an array of failed objects.- Returns:
- the failed object array.
-
getNestedException
public Exception getNestedException()
The exception may have been caused by an Exception in the runtime.- Returns:
- the nested Exception.
-
toString
public String toString()
The String representation includes the name of the class, the descriptive comment (if any), the String representation of the nested Exception (if any), and the String representation of the failed Object array (if any).
-
printStackTrace
public void printStackTrace()
Prints thisJDOException
and its backtrace to the standard error output. Prints nested Throwables' stack trace as well.- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
Prints thisJDOException
and its backtrace to the specified print stream. Prints nested Throwable's stack trace as well.- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-PrintStream
to use for output
-
printStackTrace
public void printStackTrace(PrintWriter s)
Prints thisJDOException
and its backtrace to the specified print writer. Prints nested Throwable's stack trace as well.- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-PrintWriter
to use for output
-
-