|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectmultex.Util
Utilities for MulTEx.
Usually methods of this class should not be called by framework client code.
Each exception (chain) should be reported by methods of classes
Msg or Awt, or Swing.
But if the format of the mentioned reporting classes is not approriate
for your purposes, then you can create your own reporting methods by
the help of this MulTEx utility class.
| Nested Class Summary | |
static class |
Util.MyDemoExc
The demonstration of action ''{0}'' failed by fault of person {1}. |
| Field Summary | |
static char |
causeIndenter
The char used to indent one level of causal chain when reporting the messages or stack trace of an exception chain. |
static java.lang.String |
lineSeparator
Returns the line separator for the actual platform. |
static java.lang.String |
wasCausing
The string used to delimit the stack trace part of a causing exception from the following stack trace of the caused exception. |
| Constructor Summary | |
Util()
|
|
| Method Summary | |
static java.lang.Object[] |
clone(java.lang.Object[] i_array)
Returns a new copy of the array or null, if null was provided |
static java.lang.Throwable |
getCause(java.lang.Throwable i_throwable)
Result: The directly causing Throwable of i_throwable, if there is one, otherwise null. |
static java.lang.Throwable[] |
getCauses(java.lang.Throwable i_throwable)
Result: The directly causing Throwables of i_throwable, if there are some, otherwise null. |
static java.lang.Throwable |
getContainedException(java.lang.Throwable i_throwableChain,
java.lang.Class i_expectedThrowableClass)
Returns the upmost exception in i_throwableChain, which is of class i_expectedThrowableClass, helpwise null. |
static java.lang.Throwable |
getOriginalException(java.lang.Throwable i_throwable)
Result: The deepest Throwable object, which indirectly caused the program to throw i_throwable, if there is one, otherwise i_throwable itself. |
static boolean |
jreHasExceptionChaining()
Returns true, if class java.lang.Throwable has an operation getCause() in this Java Runtime Environment |
static void |
setCauseGetter(CauseGetter i_causeGetter)
Sets a CauseGetter to be used by method getCause(Throwable)
in order to get the cause of a Throwable object.
|
static java.lang.String |
toString(java.lang.Throwable i_throwable)
For low level reporting of an exception. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String lineSeparator
public static final java.lang.String wasCausing
public static final char causeIndenter
| Constructor Detail |
public Util()
| Method Detail |
public static java.lang.Object[] clone(java.lang.Object[] i_array)
public static final void setCauseGetter(CauseGetter i_causeGetter)
getCause(Throwable)
in order to get the cause of a Throwable object.
Default is ReflectionCauseGetter
public static final java.lang.Throwable[] getCauses(java.lang.Throwable i_throwable)
ReflectionCauseGetter
by default. You can replace the cause getter by method setCauseGetter(multex.CauseGetter).
The cause getter is used only for getting a cause, which is returned by
a method of the Throwable. All MulTEx parameters of this Throwable, which are themselves
instances of Throwable, are returned, too.
public static final java.lang.Throwable getCause(java.lang.Throwable i_throwable)
ReflectionCauseGetter
by default. You can replace the cause getter by method setCauseGetter(multex.CauseGetter).
public static boolean jreHasExceptionChaining()
public static java.lang.Throwable getContainedException(java.lang.Throwable i_throwableChain,
java.lang.Class i_expectedThrowableClass)
public static final java.lang.Throwable getOriginalException(java.lang.Throwable i_throwable)
getCause(Throwable)public static java.lang.String toString(java.lang.Throwable i_throwable)
MultexException, too.
But some legacy-chained exceptions like org.xml.sax.SAXException suppress the class name of this exception and instead of it return the toString() of the causing exception. As to obtain all exception class names in a causal chain, we use our own toString(), which includes firstly a mere copy of Throwable.toString().and then the toString() of the reported exception.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||