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

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

public class ThrowableProxy
extends Throwable

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 addSuppressed(Throwable exception)
          Added in Java 7.
 Throwable fillInStackTrace()
           
 void formatWrapper(StringBuilder sb, ThrowableProxy cause)
          Formats the specified Throwable.
 Throwable getCause()
           
 String getExtendedStackTrace()
          Format the stack trace including packaging information.
 String getLocalizedMessage()
           
 String getMessage()
           
 String getRootCauseStackTrace()
          Format the Throwable that is the cause of this Throwable.
 StackTraceElement[] getStackTrace()
           
 Throwable[] getSuppressed()
          Added in Java 7.
 String getSuppressedStackTrace()
          Format the suppressed Throwables.
 Throwable initCause(Throwable throwable)
           
 void printStackTrace()
           
 void printStackTrace(PrintStream printStream)
           
 void printStackTrace(PrintWriter printWriter)
           
 void setStackTrace(StackTraceElement[] stackTraceElements)
           
 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

setStackTrace

public void setStackTrace(StackTraceElement[] stackTraceElements)
Overrides:
setStackTrace in class Throwable

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

getLocalizedMessage

public String getLocalizedMessage()
Overrides:
getLocalizedMessage in class Throwable

getCause

public Throwable getCause()
Overrides:
getCause in class Throwable

addSuppressed

public void addSuppressed(Throwable exception)
Added in Java 7.

Parameters:
exception - A Throwable that was suppressed.

getSuppressed

public Throwable[] getSuppressed()
Added in Java 7.

Returns:
Any suppressed exceptions.

initCause

public Throwable initCause(Throwable throwable)
Overrides:
initCause in class Throwable

toString

public String toString()
Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream printStream)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter printWriter)
Overrides:
printStackTrace in class Throwable

fillInStackTrace

public Throwable fillInStackTrace()
Overrides:
fillInStackTrace in class Throwable

getStackTrace

public StackTraceElement[] getStackTrace()
Overrides:
getStackTrace in class Throwable

getRootCauseStackTrace

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

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.

getExtendedStackTrace

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

Returns:
The formatted stack trace including packaging information.

getSuppressedStackTrace

public String getSuppressedStackTrace()
Format the suppressed Throwables.

Returns:
The formatted suppressed Throwables.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.