Package org.exolab.castor.util
Class NestedIOException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.exolab.castor.util.NestedIOException
- All Implemented Interfaces:
Serializable
An exception that is used to signal I/O errors which are caused by other exceptions. This class
allows the user get to the original exception.
- Version:
- $Revision$ $Date: 2005-12-13 14:58:48 -0700 (Tue, 13 Dec 2005) $
- Author:
- Keith Visco
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NestedIOException with no message, or nested ExceptionNestedIOException
(Exception exception) Creates a new NestedIOException with the given nested exception.NestedIOException
(String message) Creates a new NestedIOException with the given message.NestedIOException
(String message, Exception exception) Creates a new NestedIOException with the given message and nested exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.void
void
printStackTrace
(PrintStream printer) void
printStackTrace
(PrintWriter printer) void
setLocalStackTraceOnly
(boolean localTrace) Sets whether or not to print the local stack trace or the nested stack trace when calls to #printStackTrace are made.toString()
Returns the String representation of this Exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Constructor Details
-
NestedIOException
public NestedIOException()Creates a new NestedIOException with no message, or nested Exception -
NestedIOException
Creates a new NestedIOException with the given message.- Parameters:
message
- the message for this Exception
-
NestedIOException
Creates a new NestedIOException with the given nested exception.- Parameters:
exception
- the nested exception. (Must not be null).
-
NestedIOException
-
-
Method Details
-
getException
Returns the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.- Returns:
- the exception, which in turn caused this Exception to be thrown, or null if nested exception exists.
-
setLocalStackTraceOnly
public void setLocalStackTraceOnly(boolean localTrace) Sets whether or not to print the local stack trace or the nested stack trace when calls to #printStackTrace are made. By default the nested exception is used for printing stack trace.- Parameters:
localTrace
- a boolean when true enables local stack trace only.
-
toString
-
printStackTrace
public void printStackTrace()- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-