|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception de.smartics.exceptions.AbstractCoreException
public abstract class AbstractCoreException
The base implementation of the core exception that supports unique identifying and exception codes for checked exceptions.
Field Summary | |
---|---|
protected de.smartics.exceptions.ExceptionInfo |
info Reference to common exception information. |
Constructor Summary | |
---|---|
protected |
AbstractCoreException(Code code) Constructor. |
protected |
AbstractCoreException(String message, Code code) Constructor. |
protected |
AbstractCoreException(String message, Throwable cause, Code code) Constructor. |
protected |
AbstractCoreException(Throwable cause, Code code) Constructor. |
Method Summary | |
---|---|
Throwable |
getCause() Returns the cause of this throwable or null if the cause is nonexistent or unknown. |
protected ClassLoader |
getClassLoader() Returns a class loader to provide resources from the class path. |
Code |
getCode() Returns the error or exception code of the exception. |
ExceptionId<?> |
getId() Returns the unique identifier of the exception. |
Date |
getTime() Returns the time the exception has been raised. |
String |
toString() Returns the string representation of the exception. |
void |
truncateCause() Truncates the cause from the exception dependent on the ThrowableHandleMode set to the thread-local context. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.smartics.exceptions.CoreException |
---|
getLocalizedMessage, getMessage, getStackTrace, setStackTrace |
Field Detail |
---|
protected final de.smartics.exceptions.ExceptionInfo info
Constructor Detail |
---|
protected AbstractCoreException(Code code)
code
- the error or exception code of the exception.
AbstractCoreException(String, Throwable, Code)
protected AbstractCoreException(String message, Code code)
message
- the detail message (which is saved for later retrieval by the
Throwable.getMessage()
method). Only used if there is no localized message in the bundle.
code
- the error or exception code of the exception.
AbstractCoreException(String, Throwable, Code)
protected AbstractCoreException(Throwable cause, Code code)
cause
- the cause (which is saved for later retrieval by the
getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
code
- the error or exception code of the exception.
AbstractCoreException(String, Throwable, Code)
protected AbstractCoreException(String message, Throwable cause, Code code) throws NullPointerException
message
- the detail message (which is saved for later retrieval by the
Throwable.getMessage()
method). Only used if there is no localized message in the bundle.
cause
- the cause (which is saved for later retrieval by the
getCause()
method). (A
null value is permitted, and indicates that the cause is nonexistent or unknown.)
code
- the error or exception code of the exception.
NullPointerException
- if the code is
null
.
Exception.Exception(java.lang.String,java.lang.Throwable)
Method Detail |
---|
public final ExceptionId<?> getId()
CoreException
This identifier must never be null
.
getId
in interface
CoreException
public final Code getCode()
CoreException
This code must never be null
.
getCode
in interface
CoreException
public final Date getTime()
CoreException
getTime
in interface
CoreException
public final Throwable getCause()
CoreException
null
if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)
This implementation returns the cause that was supplied via one of the constructors requiring a Throwable. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.
getCause
in interface
CoreException
getCause
in class
Throwable
null
if the cause is nonexistent or unknown.
public final void truncateCause()
CoreException
ThrowableHandleMode
set to the thread-local context. After running this method the cause will be truncate and the full stack trace will no longer be available.
truncateCause
in interface
CoreException
protected final ClassLoader getClassLoader()
public String toString()
May be overridden by subclasses in an application (not a library) to change the string representation. Usually an implementation of CodeMessageFormatter
should be set to the de.smartics.exceptions.ExceptionContext
.
toString
in class
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |