Class NestedRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.apache.fop.render.afp.exceptions.NestedRuntimeException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RendererRuntimeException
public abstract class NestedRuntimeException extends java.lang.RuntimeException
Handy class for wrapping runtime Exceptions with a root cause. This technique is no longer necessary in Java 1.4, which provides built-in support for exception nesting. Thus exceptions in applications written to use Java 1.4 need not extend this class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwable
underlyingException
Root cause of this nested exception
-
Constructor Summary
Constructors Constructor Description NestedRuntimeException(java.lang.String msg)
Construct aNestedRuntimeException
with the specified detail message.NestedRuntimeException(java.lang.String msg, java.lang.Throwable t)
Construct aNestedRuntimeException
with the specified detail message and nested exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMessage()
Return the detail message, including the message from the nested exception if there is one.java.lang.Throwable
getUnderlyingException()
Gets the original triggering exceptionvoid
printStackTrace(java.io.PrintStream ps)
Print the composite message and the embedded stack trace to the specified stream.void
printStackTrace(java.io.PrintWriter pw)
Print the composite message and the embedded stack trace to the specified writer.
-
-
-
Constructor Detail
-
NestedRuntimeException
public NestedRuntimeException(java.lang.String msg)
Construct aNestedRuntimeException
with the specified detail message.- Parameters:
msg
- The detail message.
-
NestedRuntimeException
public NestedRuntimeException(java.lang.String msg, java.lang.Throwable t)
Construct aNestedRuntimeException
with the specified detail message and nested exception.- Parameters:
msg
- The detail message.t
- The nested exception.
-
-
Method Detail
-
getUnderlyingException
public java.lang.Throwable getUnderlyingException()
Gets the original triggering exception- Returns:
- The original exception as a throwable.
-
getMessage
public java.lang.String getMessage()
Return the detail message, including the message from the nested exception if there is one.- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- The detail message.
-
printStackTrace
public void printStackTrace(java.io.PrintStream ps)
Print the composite message and the embedded stack trace to the specified stream.- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
ps
- the print stream
-
printStackTrace
public void printStackTrace(java.io.PrintWriter pw)
Print the composite message and the embedded stack trace to the specified writer.- Overrides:
printStackTrace
in classjava.lang.Throwable
- Parameters:
pw
- the print writer
-
-