xl2.util
Class NestedException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--java.lang.RuntimeException
|
+--xl2.util.NestedException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- TransactionException, XL2Exception
- public class NestedException
- extends java.lang.RuntimeException
RuntimeException most likely wrapping some other exception and
delegates all method calls to the inner exception.
- See Also:
- Serialized Form
Method Summary |
java.lang.Exception |
getException()
The inner exception. |
java.lang.String |
getLocalizedMessage()
Creates a localized description of this Throwable . |
java.lang.String |
getMessage()
Returns the error message string of this throwable object. |
void |
printStackTrace()
Prints this Throwable and its backtrace to the
standard error stream. |
void |
printStackTrace(java.io.PrintStream s)
Prints this Throwable and its backtrace to the
specified print stream. |
void |
printStackTrace(java.io.PrintWriter s)
Prints this Throwable and its backtrace to the specified
print writer. |
java.lang.String |
toString()
Returns a short description of this throwable object. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
NestedException
public NestedException()
NestedException
public NestedException(java.lang.Exception x)
NestedException
public NestedException(java.lang.String message)
getException
public java.lang.Exception getException()
- The inner exception.
getLocalizedMessage
public java.lang.String getLocalizedMessage()
- Description copied from class:
java.lang.Throwable
- Creates a localized description of this
Throwable
.
Subclasses may override this method in order to produce a
locale-specific message. For subclasses that do not override this
method, the default implementation returns the same result as
getMessage()
.
- Overrides:
getLocalizedMessage
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- Returns:
- The localized description of this
Throwable
.
getMessage
public java.lang.String getMessage()
- Description copied from class:
java.lang.Throwable
- Returns the error message string of this throwable object.
- Overrides:
getMessage
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- Returns:
- the error message string of this
Throwable
object if it was created
with an
error message string; or null
if it was
created
with no error message.
printStackTrace
public void printStackTrace()
- Description copied from class:
java.lang.Throwable
- Prints this
Throwable
and its backtrace to the
standard error stream. This method prints a stack trace for this
Throwable
object on the error output stream that is
the value of the field System.err
. The first line of
output contains the result of the Throwable.toString()
method for
this object. Remaining lines represent data previously recorded by
the method Throwable.fillInStackTrace()
. The format of this
information depends on the implementation, but the following
example may be regarded as typical:
java.lang.NullPointerException
at MyClass.mash(MyClass.java:9)
at MyClass.crunch(MyClass.java:6)
at MyClass.main(MyClass.java:3)
This example was produced by running the program:
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:
printStackTrace
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- See Also:
java.lang.System#err
printStackTrace
public void printStackTrace(java.io.PrintStream s)
- Description copied from class:
java.lang.Throwable
- Prints this
Throwable
and its backtrace to the
specified print stream.
- Overrides:
printStackTrace
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- Parameters:
s
- PrintStream
to use for output
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
- Description copied from class:
java.lang.Throwable
- Prints this
Throwable
and its backtrace to the specified
print writer.
- Overrides:
printStackTrace
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- Parameters:
s
- PrintWriter
to use for output
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Throwable
- Returns a short description of this throwable object.
If this
Throwable
object was
created
with an error 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
Throwable.getMessage()
method for this object
If this Throwable
object was created
with no error message string, then the name of the actual class of
this object is returned.
- Overrides:
toString
in class java.lang.Throwable
- Following copied from class:
java.lang.Throwable
- Returns:
- a string representation of this
Throwable
.