Java org.apache.commons.lang.exception ExceptionUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang.exception ExceptionUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang.exception ExceptionUtils.

The text is from its open source code.

Subclass

org.apache.commons.lang.exception.ExceptionUtils has subclasses.
Click this link to see all its subclasses.

Method

ThrowablegetCause(Throwable throwable)

Introspects the Throwable to obtain the cause.

The method searches for methods with specific names that return a Throwable object.

StringgetFullStackTrace(Throwable throwable)

A way to get the entire nested stack-trace of an throwable.

The result of this method is highly dependent on the JDK version and whether the exceptions override printStackTrace or not.

StringgetMessage(Throwable th)
Gets a short message summarising the exception.
ThrowablegetRootCause(Throwable throwable)

Introspects the Throwable to obtain the root cause.

This method walks through the exception chain to the last element, "root" of the tree, using #getCause(Throwable) , and returns that exception.

From version 2.2, this method handles recursive cause structures that might otherwise cause infinite loops.

StringgetRootCauseMessage(Throwable th)
Gets a short message summarising the root cause exception.
String[]getRootCauseStackTrace(Throwable throwable)

Creates a compact stack trace for the root cause of the supplied Throwable.

The output of this method is consistent across JDK versions.

String[]getStackFrames(Throwable throwable)

Captures the stack trace associated with the specified Throwable object, decomposing it into a list of stack frames.

The result of this method vary by JDK version as this method uses Throwable#printStackTrace(java.io.PrintWriter) .

String[]getStackFrames(String stackTrace)

Returns an array where each element is a line from the argument.

The end of line is determined by the value of SystemUtils#LINE_SEPARATOR .

Functionality shared between the getStackFrames(Throwable) methods of this and the org.apache.commons.lang.exception.NestableDelegate classes.

StringgetStackTrace(Throwable throwable)

Gets the stack trace from a Throwable as a String.

The result of this method vary by JDK version as this method uses Throwable#printStackTrace(java.io.PrintWriter) .

intgetThrowableCount(Throwable throwable)

Counts the number of Throwable objects in the exception chain.

A throwable without cause will return 1.

ListgetThrowableList(Throwable throwable)

Returns the list of Throwable objects in the exception chain.

A throwable without cause will return a list containing one element - the input throwable.

Throwable[]getThrowables(Throwable throwable)

Returns the list of Throwable objects in the exception chain.

A throwable without cause will return an array containing one element - the input throwable.

intindexOfThrowable(Throwable throwable, Class clazz)

Returns the (zero based) index of the first Throwable that matches the specified class (exactly) in the exception chain.

intindexOfType(Throwable throwable, Class type)

Returns the (zero based) index of the first Throwable that matches the specified class or subclass in the exception chain.

voidprintRootCauseStackTrace(Throwable throwable)

Prints a compact stack trace for the root cause of a throwable to System.err.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.

voidprintRootCauseStackTrace(Throwable throwable, PrintStream stream)

Prints a compact stack trace for the root cause of a throwable.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.

voidprintRootCauseStackTrace(Throwable throwable, PrintWriter writer)

Prints a compact stack trace for the root cause of a throwable.

The compact stack trace starts with the root cause and prints stack frames up to the place where it was caught and wrapped.