|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object | +--java.lang.Throwable
This class is the superclass of all classes which can be thrown by the virtual machine. The two direct subclasses represent recoverable exceptions (Exception) and unrecoverable errors (Error). This class provides common methods for accessing a string message which provides extra information about the circumstances in which the throwable was created, and for filling in a walkback (i.e. a record of the call stack at a particular point in time) which can be printed later.
Error,
Exception,
RuntimeException,
Serialized Form| Constructor Summary | |
|---|---|
Throwable()
Constructs a new instance of this class with its walkback filled in. |
|
Throwable(String detailMessage)
Constructs a new instance of this class with its walkback and message filled in. |
|
Throwable(String detailMessage,
Throwable throwable)
Constructs a new instance of this class with its walkback, message and cause filled in. |
|
Throwable(Throwable throwable)
Constructs a new instance of this class with its walkback and cause filled in. |
|
| Method Summary | |
|---|---|
Throwable |
fillInStackTrace()
Record in the receiver a walkback from the point where this message was sent. |
Throwable |
getCause()
Answers the cause of this Throwable, or null if there is no cause. |
String |
getLocalizedMessage()
Answers the extra information message which was provided when the throwable was created. |
String |
getMessage()
Answers the extra information message which was provided when the throwable was created. |
StackTraceElement[] |
getStackTrace()
Answers an array of StackTraceElement. |
Throwable |
initCause(Throwable throwable)
Initialize the cause of the receiver. |
void |
printStackTrace()
Outputs a printable representation of the receiver's walkback on the System.err stream. |
void |
printStackTrace(PrintStream err)
Outputs a printable representation of the receiver's walkback on the stream specified by the argument. |
void |
printStackTrace(PrintWriter err)
Outputs a printable representation of the receiver's walkback on the writer specified by the argument. |
void |
setStackTrace(StackTraceElement[] trace)
Sets the array of StackTraceElements. |
String |
toString()
Answers a string containing a concise, human-readable description of the receiver. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Throwable()
public Throwable(String detailMessage)
detailMessage - String
The detail message for the exception.public Throwable(String detailMessage,
Throwable throwable)
detailMessage - String
The detail message for the exception.throwable - The cause of this Throwablepublic Throwable(Throwable throwable)
throwable - The cause of this Throwable| Method Detail |
public Throwable fillInStackTrace()
public String getMessage()
public String getLocalizedMessage()
public StackTraceElement[] getStackTrace()
public void setStackTrace(StackTraceElement[] trace)
trace - The array of StackTraceElementpublic void printStackTrace()
public void printStackTrace(PrintStream err)
err - PrintStream
The stream to write the walkback on.public void printStackTrace(PrintWriter err)
err - PrintWriter
The writer to write the walkback on.public String toString()
toString in class Objectpublic Throwable initCause(Throwable throwable)
throwable - The cause of this Throwable
IllegalArgumentException - when the cause is the receiver
IllegalStateException - when the cause has already been initializedpublic Throwable getCause()
|
Final | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||