Class StackableException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.pentaho.reporting.libraries.base.util.StackableException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ModuleInitializeException,UnsupportedEncoderException
public class StackableException extends java.lang.ExceptionA baseclass for exceptions, which could have parent exceptions. These parent exceptions are raised in a subclass and are now wrapped into a subclass of this Exception. The parents are printed when this exception is printed. This class exists mainly for debugging reasons, as with them it is easier to detect the root cause of an error.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetMessage()Returns the detail message string of this throwable.java.lang.ExceptiongetParent()Deprecated.use the throwable instead.java.lang.ThrowablegetParentThrowable()voidprintStackTrace()Prints thisThrowableand its backtrace to the standard error stream.voidprintStackTrace(java.io.PrintStream stream)Prints the stack trace to the specified stream.voidprintStackTrace(java.io.PrintWriter writer)Prints the stack trace to the specified writer.java.lang.StringtoString()Returns a short description of this throwable.
-
-
-
Method Detail
-
getParent
public java.lang.Exception getParent()
Deprecated.use the throwable instead.Returns the parent exception (possibly null).- Returns:
- the parent exception.
-
getParentThrowable
public java.lang.Throwable getParentThrowable()
-
getMessage
public java.lang.String getMessage()
Returns the detail message string of this throwable.- Overrides:
getMessagein classjava.lang.Throwable- Returns:
- the detail message string of this Throwable instance (which may be null).
-
toString
public java.lang.String toString()
Returns a short description of this throwable. If thisThrowableobject was created with a non-null detail message string, then the result is the concatenation of three strings:- The name of the actual class of this object
- ": " (a colon and a space)
- The result of the
getMessage()method for this object
Throwableobject was created with a null detail message string, then the name of the actual class of this object is returned.- Overrides:
toStringin classjava.lang.Throwable- Returns:
- a string representation of this throwable.
-
printStackTrace
public void printStackTrace(java.io.PrintStream stream)
Prints the stack trace to the specified stream.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
stream- the output stream.
-
printStackTrace
public void printStackTrace(java.io.PrintWriter writer)
Prints the stack trace to the specified writer.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
writer- the writer.
-
printStackTrace
public void printStackTrace()
Prints thisThrowableand its backtrace to the standard error stream. This method prints a stack trace for thisThrowableobject on the error output stream that is the value of the fieldSystem.err. The first line of output contains the result of thetoString()method for this object. Remaining lines represent data previously recorded by the methodThrowable.fillInStackTrace(). The format of this information depends on the implementation, but the following example may be regarded as typical:
This example was produced by running the program:java.lang.NullPointerException at MyClass.mash(MyClass.java:9) at MyClass.crunch(MyClass.java:6) at MyClass.main(MyClass.java:3)class MyClass { public static void main(String[] argv) { crunch(null); } static void crunch(int[] a) { mash(a); } static void mash(int[] b) { System.out.println(b[0]); } }- Overrides:
printStackTracein classjava.lang.Throwable- See Also:
System.err
-
-