public abstract class TopLinkException extends RuntimeException
Purpose: Any exception raised by TopLink should be a subclass of this exception class.
Modifier and Type | Field and Description |
---|---|
protected static String |
CR |
protected int |
errorCode |
protected boolean |
hasBeenLogged |
protected String |
indentationString |
protected Throwable |
internalException |
protected AbstractSession |
session |
protected static Boolean |
shouldPrintInternalException |
Constructor and Description |
---|
TopLinkException()
INTERNAL:
Return a new exception.
|
TopLinkException(String theMessage)
INTERNAL:
TopLink exception should only be thrown by TopLink.
|
TopLinkException(String message,
Throwable internalException)
INTERNAL:
TopLink exception should only be thrown by TopLink.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
cr()
INTERNAL:
Convenience method - return a platform-specific line-feed.
|
int |
getErrorCode()
PUBLIC:
Return the exception error code.
|
String |
getIndentationString()
INTERNAL:
Used to print things nicely in the testing tool.
|
Throwable |
getInternalException()
PUBLIC:
Return the internal native exception.
|
String |
getMessage()
PUBLIC:
Return the exception error message.
|
AbstractSession |
getSession()
PUBLIC:
Return the session.
|
boolean |
hasBeenLogged()
INTERNAL:
Return if this exception has been logged to avoid being logged more than once.
|
void |
printStackTrace()
PUBLIC:
Print both the normal and internal stack traces.
|
void |
printStackTrace(PrintStream outStream)
PUBLIC:
Print both the normal and internal stack traces.
|
void |
printStackTrace(PrintWriter writer)
PUBLIC:
Print both the normal and internal stack traces.
|
void |
setErrorCode(int errorCode)
INTERNAL:
|
void |
setHasBeenLogged(boolean logged)
INTERNAL:
Set this flag to avoid logging an exception more than once.
|
void |
setIndentationString(String indentationString)
INTERNAL:
Used to print things nicely in the testing tool.
|
void |
setInternalException(Throwable anException)
INTERNAL:
Used to specify the internal exception.
|
void |
setSession(AbstractSession session)
INTERNAL:
|
static void |
setShouldPrintInternalException(boolean printException)
PUBLIC:
Allows overiding of TopLink's exception chaining detection.
|
static boolean |
shouldPrintInternalException()
INTERNAL
Check to see if the TopLink-stored internal exception should be printed in this
a TopLinkException's stack trace.
|
String |
toString()
INTERNAL:
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
protected transient AbstractSession session
protected Throwable internalException
protected static Boolean shouldPrintInternalException
protected String indentationString
protected int errorCode
protected static final String CR
protected boolean hasBeenLogged
public TopLinkException()
public TopLinkException(String theMessage)
protected static String cr()
public int getErrorCode()
public String getIndentationString()
public Throwable getInternalException()
public String getMessage()
getMessage
in class Throwable
public AbstractSession getSession()
public boolean hasBeenLogged()
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintStream outStream)
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter writer)
printStackTrace
in class Throwable
public void setErrorCode(int errorCode)
public void setHasBeenLogged(boolean logged)
public void setIndentationString(String indentationString)
public void setInternalException(Throwable anException)
public void setSession(AbstractSession session)
public static void setShouldPrintInternalException(boolean printException)
booleam
- printException - If printException is true, the TopLink-stored
Internal exception will be included in a stack traceor in the exception message of a TopLinkException.
If printException is false, the TopLink-stored Internal Exception will not be included
in the stack trace or the exception message of TopLinkExceptionspublic static boolean shouldPrintInternalException()
Copyright © 2023. All rights reserved.