Package org.apache.openjpa.util
Class OpenJPAException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.openjpa.util.OpenJPAException
-
- All Implemented Interfaces:
java.io.Serializable
,ExceptionInfo
- Direct Known Subclasses:
GeneralException
,InternalException
,StoreException
,UnsupportedException
,UserException
,ValidationUnavailableException
,WrappedException
public abstract class OpenJPAException extends java.lang.RuntimeException implements java.io.Serializable, ExceptionInfo
Exception type for all OpenJPA exceptions. Meant to be easily transformed into an appropriate exception at the API layer, since most APIs define their own exception types.- Since:
- 0.4.0
- Author:
- Abe White
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.util.ExceptionInfo
GENERAL, INTERNAL, STORE, UNAVAILABLE, UNSUPPORTED, USER, WRAPPED
-
-
Constructor Summary
Constructors Constructor Description OpenJPAException()
Default constructor.OpenJPAException(java.lang.String msg)
Constructor; supply message.OpenJPAException(java.lang.String msg, java.lang.Throwable cause)
Construct with message and cause.OpenJPAException(java.lang.Throwable cause)
Construct with cause.OpenJPAException(Localizer.Message msg)
Constructor; supply message.OpenJPAException(Localizer.Message msg, java.lang.Throwable cause)
Construct with message and cause.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getCause()
Returns the firstThrowable
fromgetNestedThrowables()
in order to conform toThrowable.getCause()
in Java 1.4+.java.lang.Object
getFailedObject()
The failed object.java.lang.Throwable[]
getNestedThrowables()
The nested throwables.int
getSubtype()
Exception subtype.abstract int
getType()
Exception type.boolean
isFatal()
Whether this error is fatal.void
printStackTrace()
Stack.void
printStackTrace(java.io.PrintStream out)
void
printStackTrace(java.io.PrintWriter out)
OpenJPAException
setCause(java.lang.Throwable nested)
The first nested throwable.OpenJPAException
setFailedObject(java.lang.Object failed)
The failed object.OpenJPAException
setFatal(boolean fatal)
Whether this error is fatal.OpenJPAException
setNestedThrowables(java.lang.Throwable[] nested)
The nested throwables.java.lang.String
toString()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.util.ExceptionInfo
getMessage
-
-
-
-
Constructor Detail
-
OpenJPAException
public OpenJPAException()
Default constructor.
-
OpenJPAException
public OpenJPAException(java.lang.String msg)
Constructor; supply message.
-
OpenJPAException
public OpenJPAException(Localizer.Message msg)
Constructor; supply message.
-
OpenJPAException
public OpenJPAException(java.lang.Throwable cause)
Construct with cause.
-
OpenJPAException
public OpenJPAException(java.lang.String msg, java.lang.Throwable cause)
Construct with message and cause.
-
OpenJPAException
public OpenJPAException(Localizer.Message msg, java.lang.Throwable cause)
Construct with message and cause.
-
-
Method Detail
-
getType
public abstract int getType()
Exception type.- Specified by:
getType
in interfaceExceptionInfo
-
getSubtype
public int getSubtype()
Exception subtype.- Specified by:
getSubtype
in interfaceExceptionInfo
-
isFatal
public boolean isFatal()
Whether this error is fatal.- Specified by:
isFatal
in interfaceExceptionInfo
-
setFatal
public OpenJPAException setFatal(boolean fatal)
Whether this error is fatal.
-
getCause
public java.lang.Throwable getCause()
Returns the firstThrowable
fromgetNestedThrowables()
in order to conform toThrowable.getCause()
in Java 1.4+.- Specified by:
getCause
in interfaceExceptionInfo
- Overrides:
getCause
in classjava.lang.Throwable
- See Also:
Throwable.getCause()
-
setCause
public OpenJPAException setCause(java.lang.Throwable nested)
The first nested throwable.
-
getNestedThrowables
public java.lang.Throwable[] getNestedThrowables()
The nested throwables.- Specified by:
getNestedThrowables
in interfaceExceptionInfo
-
setNestedThrowables
public OpenJPAException setNestedThrowables(java.lang.Throwable[] nested)
The nested throwables.
-
getFailedObject
public java.lang.Object getFailedObject()
The failed object.- Specified by:
getFailedObject
in interfaceExceptionInfo
-
setFailedObject
public OpenJPAException setFailedObject(java.lang.Object failed)
The failed object.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace()
Description copied from interface:ExceptionInfo
Stack.- Specified by:
printStackTrace
in interfaceExceptionInfo
- Overrides:
printStackTrace
in classjava.lang.Throwable
- See Also:
Throwable.printStackTrace()
-
printStackTrace
public void printStackTrace(java.io.PrintStream out)
- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter out)
- Overrides:
printStackTrace
in classjava.lang.Throwable
-
-