| java.lang.Object org.apache.log.format.ExceptionUtil
ExceptionUtil | final class ExceptionUtil (Code) | | This class provides basic facilities for manipulating exceptions.
Some exception handling stuff thieved from Turbine...
author: Avalon Development Team version: 1.0 |
Method Summary | |
public static String[] | captureStackTrace(Throwable throwable) Captures the stack trace associated with this exception. | public static Throwable | getCause(Throwable throwable, boolean useReflection) Utility method to get cause of exception. | public static String | printStackTrace(Throwable throwable) Generate string for specified exception and the cause of
this exception (if any). | public static String | printStackTrace(Throwable throwable, boolean printCascading) Generate string for specified exception and if printCascading
is true will print all cascading exceptions. | public static String | printStackTrace(Throwable throwable, int depth) Serialize the specified Throwable to a string. | public static String | printStackTrace(Throwable throwable, int depth, boolean printCascading) Generate exception string for specified exception to specified depth
and all Cascading exceptions if printCascading is true. | public static String | printStackTrace(Throwable throwable, int depth, boolean printCascading, boolean useReflection) Generate exception string for specified exception to specified depth
and all Cascading exceptions if printCascading is true. | public static String[] | splitString(String string, String onToken) Splits the string on every token into an array of stack frames. |
captureStackTrace | public static String[] captureStackTrace(Throwable throwable)(Code) | | Captures the stack trace associated with this exception.
Parameters: throwable - a Throwable an array of Strings describing stack frames. |
getCause | public static Throwable getCause(Throwable throwable, boolean useReflection)(Code) | | Utility method to get cause of exception.
Parameters: throwable - a Throwable Parameters: useReflection - if true will use reflection to handle JDK1.4nested exceptions cause of specified exception |
printStackTrace | public static String printStackTrace(Throwable throwable)(Code) | | Generate string for specified exception and the cause of
this exception (if any).
Parameters: throwable - a Throwable the stack trace as a String |
printStackTrace | public static String printStackTrace(Throwable throwable, boolean printCascading)(Code) | | Generate string for specified exception and if printCascading
is true will print all cascading exceptions.
Parameters: throwable - a Throwable Parameters: printCascading - if true will print all cascading exceptions the stack trace as a String |
printStackTrace | public static String printStackTrace(Throwable throwable, int depth)(Code) | | Serialize the specified Throwable to a string.
Restrict the number of frames printed out to the specified depth.
If the depth specified is 0 then all the frames are
converted into a string.
Parameters: throwable - a Throwable Parameters: depth - number of stack trace frames to show the stack trace as a String |
printStackTrace | public static String printStackTrace(Throwable throwable, int depth, boolean printCascading)(Code) | | Generate exception string for specified exception to specified depth
and all Cascading exceptions if printCascading is true.
Parameters: throwable - a Throwable Parameters: depth - number of stack trace frames to show Parameters: printCascading - if true will print all cascading exceptions the stack trace as a String |
printStackTrace | public static String printStackTrace(Throwable throwable, int depth, boolean printCascading, boolean useReflection)(Code) | | Generate exception string for specified exception to specified depth
and all Cascading exceptions if printCascading is true. If useReflection
is true then the method will also attempt to use reflection to find a
method with signature Throwable getCause() . This makes
it compatible with JDK1.4 mechanisms for nesting exceptions.
Parameters: throwable - a Throwable Parameters: depth - number of stack trace frames to show Parameters: printCascading - if true will print all cascading exceptions Parameters: useReflection - if true will use reflection to handle JDK1.4nested exceptions the stack trace as a String |
splitString | public static String[] splitString(String string, String onToken)(Code) | | Splits the string on every token into an array of stack frames.
Parameters: string - the string to split Parameters: onToken - the token to split on the resultant array |
|
|