oracle.cabo.share.util
Class AnnotatedException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--java.lang.RuntimeException
|
+--oracle.cabo.share.util.AnnotatedException
- All Implemented Interfaces:
- java.io.Serializable, oracle.bali.share.util.WrappingThrowable
- public class AnnotatedException
- extends java.lang.RuntimeException
- implements oracle.bali.share.util.WrappingThrowable
RuntimeException class that annotates another exception,
but does so semi-invisibly. toString() and printStackTrace()
are both overridden so as to prevent code that doesn't check
for AnnotatedExceptions from swallowing the real problem.
- See Also:
- Serialized Form
Constructor Summary |
AnnotatedException(java.lang.Throwable t,
java.lang.Object annotation)
Create an AnnotatedException. |
Method Summary |
java.lang.Throwable |
getAnnotatedThrowable()
Returns the throwable being annotated. |
java.lang.Object |
getAnnotation()
Returns the annotation. |
java.lang.Throwable |
getRootCause()
Return the root cause of the underlying exception. |
void |
printStackTrace(java.io.PrintStream s)
Print a stack trace for the exception. |
java.lang.String |
toString()
Returns a string representation of this exception. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AnnotatedException
public AnnotatedException(java.lang.Throwable t,
java.lang.Object annotation)
- Create an AnnotatedException.
printStackTrace
public void printStackTrace(java.io.PrintStream s)
- Print a stack trace for the exception. Prints
the stack trace of the wrapped throwable - not the stack
trace of this exception.
- Overrides:
printStackTrace
in class java.lang.Throwable
getRootCause
public java.lang.Throwable getRootCause()
- Return the root cause of the underlying exception.
This does not return the throwable we're wrapping here,
but instead returns the root cause of the throwable being
wrapped.
- Specified by:
getRootCause
in interface oracle.bali.share.util.WrappingThrowable
getAnnotatedThrowable
public java.lang.Throwable getAnnotatedThrowable()
- Returns the throwable being annotated.
getAnnotation
public java.lang.Object getAnnotation()
- Returns the annotation.
toString
public java.lang.String toString()
- Returns a string representation of this exception.
- Overrides:
toString
in class java.lang.Throwable