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:
Serializable,ExceptionInfo
- Direct Known Subclasses:
GeneralException,InternalException,StoreException,UnsupportedException,UserException,ValidationUnavailableException,WrappedException
public abstract class OpenJPAException extends RuntimeException implements 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(String msg)Constructor; supply message.OpenJPAException(String msg, Throwable cause)Construct with message and cause.OpenJPAException(Throwable cause)Construct with cause.OpenJPAException(Localizer.Message msg)Constructor; supply message.OpenJPAException(Localizer.Message msg, Throwable cause)Construct with message and cause.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ThrowablegetCause()Returns the firstThrowablefromgetNestedThrowables()in order to conform toThrowable.getCause()in Java 1.4+.ObjectgetFailedObject()The failed object.Throwable[]getNestedThrowables()The nested throwables.intgetSubtype()Exception subtype.abstract intgetType()Exception type.booleanisFatal()Whether this error is fatal.voidprintStackTrace()Stack.voidprintStackTrace(PrintStream out)voidprintStackTrace(PrintWriter out)OpenJPAExceptionsetCause(Throwable nested)The first nested throwable.OpenJPAExceptionsetFailedObject(Object failed)The failed object.OpenJPAExceptionsetFatal(boolean fatal)Whether this error is fatal.OpenJPAExceptionsetNestedThrowables(Throwable[] nested)The nested throwables.StringtoString()-
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(String msg)
Constructor; supply message.
-
OpenJPAException
public OpenJPAException(Localizer.Message msg)
Constructor; supply message.
-
OpenJPAException
public OpenJPAException(Throwable cause)
Construct with cause.
-
OpenJPAException
public OpenJPAException(String msg, Throwable cause)
Construct with message and cause.
-
OpenJPAException
public OpenJPAException(Localizer.Message msg, Throwable cause)
Construct with message and cause.
-
-
Method Detail
-
getType
public abstract int getType()
Exception type.- Specified by:
getTypein interfaceExceptionInfo
-
getSubtype
public int getSubtype()
Exception subtype.- Specified by:
getSubtypein interfaceExceptionInfo
-
isFatal
public boolean isFatal()
Whether this error is fatal.- Specified by:
isFatalin interfaceExceptionInfo
-
setFatal
public OpenJPAException setFatal(boolean fatal)
Whether this error is fatal.
-
getCause
public Throwable getCause()
Returns the firstThrowablefromgetNestedThrowables()in order to conform toThrowable.getCause()in Java 1.4+.- Specified by:
getCausein interfaceExceptionInfo- Overrides:
getCausein classThrowable- See Also:
Throwable.getCause()
-
setCause
public OpenJPAException setCause(Throwable nested)
The first nested throwable.
-
getNestedThrowables
public Throwable[] getNestedThrowables()
The nested throwables.- Specified by:
getNestedThrowablesin interfaceExceptionInfo
-
setNestedThrowables
public OpenJPAException setNestedThrowables(Throwable[] nested)
The nested throwables.
-
getFailedObject
public Object getFailedObject()
The failed object.- Specified by:
getFailedObjectin interfaceExceptionInfo
-
setFailedObject
public OpenJPAException setFailedObject(Object failed)
The failed object.
-
printStackTrace
public void printStackTrace()
Description copied from interface:ExceptionInfoStack.- Specified by:
printStackTracein interfaceExceptionInfo- Overrides:
printStackTracein classThrowable- See Also:
Throwable.printStackTrace()
-
printStackTrace
public void printStackTrace(PrintStream out)
- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintWriter out)
- Overrides:
printStackTracein classThrowable
-
-