Class JDOException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.jdo.JDOException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JDOCanRetryException, JDOFatalException
This is the root of all JDO Exceptions. It contains an optional detail
message, an optional nested
Throwable array and an optional failed object.- Version:
- 1.0.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ObjectThis exception may be the result of incorrect parameters supplied to an API.private booleanFlag indicating whether printStackTrace is being executed.private static I18NHelperThe Internationalization message helper.(package private) Throwable[]This exception was generated because of an exception in the runtime library. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newJDOExceptionwithout a detail message.JDOException(String msg) Constructs a newJDOExceptionwith the specified detail message.JDOException(String msg, Object failed) Constructs a newJDOExceptionwith the specified detail message and failed object.JDOException(String msg, Throwable nested) Constructs a newJDOExceptionwith the specified detail message and nestedThrowable.JDOException(String msg, Throwable[] nested) Constructs a newJDOExceptionwith the specified detail message and nestedThrowables.JDOException(String msg, Throwable[] nested, Object failed) Constructs a newJDOExceptionwith the specified detail message, nestedThrowables, and failed object.JDOException(String msg, Throwable nested, Object failed) Constructs a newJDOExceptionwith the specified detail message, nestedThrowable, and failed object. -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringHelper method returning a short description of the exception passed as an argument.getCause()Often there is only one nested exception, and this method returns it.The exception may include a failed object.The exception may have been caused by multiple exceptions in the runtime.JDK 1.4 includes a new chaining mechanism for Throwable, but since JDO has its own "legacy" chaining mechanism, the "standard" mechanism cannot be used.voidPrints thisJDOExceptionand its backtrace to the standard error output.voidPrints thisJDOExceptionand its backtrace to the specified print stream.voidPrints thisJDOExceptionand its backtrace to the specified print writer.toString()TheStringrepresentation includes the name of the class, the descriptive comment (if any), theStringrepresentation of the failedObject(if any), and theStringrepresentation of the nestedThrowables (if any).Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTrace
-
Field Details
-
nested
Throwable[] nestedThis exception was generated because of an exception in the runtime library. -
failed
Object failedThis exception may be the result of incorrect parameters supplied to an API. This is the object from which the user can determine the cause of the problem. -
msg
The Internationalization message helper. -
inPrintStackTrace
private boolean inPrintStackTraceFlag indicating whether printStackTrace is being executed.
-
-
Constructor Details
-
JDOException
public JDOException()Constructs a newJDOExceptionwithout a detail message. -
JDOException
Constructs a newJDOExceptionwith the specified detail message.- Parameters:
msg- the detail message.
-
JDOException
-
JDOException
-
JDOException
-
JDOException
-
JDOException
-
-
Method Details
-
getFailedObject
The exception may include a failed object.- Returns:
- the failed object.
-
getNestedExceptions
The exception may have been caused by multiple exceptions in the runtime. If multiple objects caused the problem, each failed object will have its ownException.- Returns:
- the nested Throwable array.
-
getCause
Often there is only one nested exception, and this method returns it. If there are more than one, then this method returns the first nested exception. If there is no nested exception, then null is returned. -
initCause
JDK 1.4 includes a new chaining mechanism for Throwable, but since JDO has its own "legacy" chaining mechanism, the "standard" mechanism cannot be used. This method always throws a JDOFatalInternalException. -
toString
-
printStackTrace
public void printStackTrace()Prints thisJDOExceptionand its backtrace to the standard error output. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints thisJDOExceptionand its backtrace to the specified print stream. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintStreamto use for output
-
printStackTrace
Prints thisJDOExceptionand its backtrace to the specified print writer. Print nested Throwables' stack trace as well.- Overrides:
printStackTracein classThrowable- Parameters:
s-PrintWriterto use for output
-
exceptionToString
Helper method returning a short description of the exception passed as an argument. The returned string has the format defined by Throwable.toString. If the exception has a non-null detail message string, then it returns the name of exception class concatenated with ": " concatenated with the detailed message. Otherwise it returns the name of exception class.- Parameters:
ex- the exception to be represented.- Returns:
- a string representation of the exception passed as an argument.
-