org.apache.logging.log4j.core.impl
Class ThrowableProxy

java.lang.Object
  extended by org.apache.logging.log4j.core.impl.ThrowableProxy
All Implemented Interfaces:
Serializable

public class ThrowableProxy
extends Object
implements Serializable

Wraps a Throwable to add packaging information about each stack trace element.

See Also:
Serialized Form

Constructor Summary
ThrowableProxy(Throwable throwable)
          Construct the wrapper for the Throwable that includes packaging data.
 
Method Summary
 void formatWrapper(StringBuilder sb, ThrowableProxy cause)
          Formats the specified Throwable.
 void formatWrapper(StringBuilder sb, ThrowableProxy cause, List<String> packages)
          Formats the specified Throwable.
 ThrowableProxy getCause()
           
 int getCommonElementCount()
          Return the number of elements that are being ommitted because they are common with the parent Throwable's stack trace.
 String getExtendedStackTrace()
          Format the stack trace including packaging information.
 String getExtendedStackTrace(List<String> packages)
          Format the stack trace including packaging information.
 String getName()
          Return the FQCN of the Throwable.
 StackTracePackageElement[] getPackageData()
          Return the package data associated with the stack trace.
 String getRootCauseStackTrace()
          Format the Throwable that is the cause of this Throwable.
 String getRootCauseStackTrace(List<String> packages)
          Format the Throwable that is the cause of this Throwable.
 ThrowableProxy[] getSuppressed()
           
 String getSuppressedStackTrace()
          Format the suppressed Throwables.
 Throwable getThrowable()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThrowableProxy

public ThrowableProxy(Throwable throwable)
Construct the wrapper for the Throwable that includes packaging data.

Parameters:
throwable - The Throwable to wrap.
Method Detail

getThrowable

public Throwable getThrowable()

getCause

public ThrowableProxy getCause()

getName

public String getName()
Return the FQCN of the Throwable.

Returns:
The FQCN of the Throwable.

getCommonElementCount

public int getCommonElementCount()
Return the number of elements that are being ommitted because they are common with the parent Throwable's stack trace.

Returns:
The number of elements ommitted from the stack trace.

getPackageData

public StackTracePackageElement[] getPackageData()
Return the package data associated with the stack trace.

Returns:
The package data associated with the stack trace.

toString

public String toString()
Overrides:
toString in class Object

getRootCauseStackTrace

public String getRootCauseStackTrace()
Format the Throwable that is the cause of this Throwable.

Returns:
The formatted Throwable that caused this Throwable.

getRootCauseStackTrace

public String getRootCauseStackTrace(List<String> packages)
Format the Throwable that is the cause of this Throwable.

Parameters:
packages - The List of packages to be suppressed from the trace.
Returns:
The formatted Throwable that caused this Throwable.

formatWrapper

public void formatWrapper(StringBuilder sb,
                          ThrowableProxy cause)
Formats the specified Throwable.

Parameters:
sb - StringBuilder to contain the formatted Throwable.
cause - The Throwable to format.

formatWrapper

public void formatWrapper(StringBuilder sb,
                          ThrowableProxy cause,
                          List<String> packages)
Formats the specified Throwable.

Parameters:
sb - StringBuilder to contain the formatted Throwable.
cause - The Throwable to format.
packages - The List of packages to be suppressed from the trace.

getExtendedStackTrace

public String getExtendedStackTrace()
Format the stack trace including packaging information.

Returns:
The formatted stack trace including packaging information.

getExtendedStackTrace

public String getExtendedStackTrace(List<String> packages)
Format the stack trace including packaging information.

Parameters:
packages - List of packages to be suppressed from the trace.
Returns:
The formatted stack trace including packaging information.

getSuppressedStackTrace

public String getSuppressedStackTrace()
Format the suppressed Throwables.

Returns:
The formatted suppressed Throwables.

getSuppressed

public ThrowableProxy[] getSuppressed()


Copyright © 1999-2013 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.