|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception org.yajul.util.ExceptionList
public class ExceptionList
A checked exception that contains a list of other exceptions.
User: josh
Date: Oct 24, 2003
Time: 7:51:20 AM
Constructor Summary | |
---|---|
ExceptionList()
Constructs a new exception with null as its detail message. |
|
ExceptionList(java.lang.String message)
Constructs a new exception with the specified detail message. |
|
ExceptionList(java.lang.String message,
java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause. |
|
ExceptionList(java.lang.Throwable cause)
Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). |
Method Summary | |
---|---|
void |
add(java.lang.Throwable t)
Adds a new exception (Throwable) to the list. |
java.lang.Throwable |
getCause()
Returns the cause of this throwable or null if the
cause is nonexistent or unknown. |
java.lang.String |
getLocalizedMessage()
Creates a localized description of this throwable. |
java.lang.String |
getMessage()
Returns the detail message string of this throwable. |
java.util.Iterator |
iterator()
Returns an iterator which will provide all of the Throwables. |
void |
printStackTrace()
Prints a stack trace. |
void |
printStackTrace(java.io.PrintStream s)
Prints a stack trace to the specified print stream. |
void |
printStackTrace(java.io.PrintWriter w)
Prints this throwable and its backtrace to the specified print writer. |
int |
size()
Returns the number of throwables in the list. |
void |
throwIfException()
Throws this ExceptionList object if there are more than one throwables in the list. |
void |
throwIfThrowable()
Throws this ExceptionList object if there are more than one throwables in the list. |
java.lang.String |
toString()
Converts everything to a string. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getStackTrace, initCause, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExceptionList()
null
as its detail message.
The cause is not initialized, and may subsequently be initialized by a
call to initCause.
public ExceptionList(java.lang.String message)
message
- the detail message. The detail message is saved for
later retrieval by the getMessage()
method.public ExceptionList(java.lang.String message, java.lang.Throwable cause)
Note that the detail message associated with
cause
is not automatically incorporated in
this exception's detail message.
message
- the detail message (which is saved for later retrieval
by the getMessage()
method).cause
- the cause (which is saved for later retrieval by the
getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)public ExceptionList(java.lang.Throwable cause)
java.security.PrivilegedActionException
).
cause
- the cause (which is saved for later retrieval by the
getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)Method Detail |
---|
public java.lang.Throwable getCause()
null
if the
cause is nonexistent or unknown. (The cause is the throwable that
caused this throwable to get thrown.)
This implementation returns the cause that was supplied via one of the constructors requiring a Throwable, or that was set after creation with the initCause(Throwable) method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means. This is appropriate for a "legacy chained throwable" that predates the addition of chained exceptions to Throwable. Note that it is not necessary to override any of the PrintStackTrace methods, all of which invoke the getCause method to determine the cause of a throwable.
getCause
in class java.lang.Throwable
null
if the
cause is nonexistent or unknown.public java.lang.String toString()
toString
in class java.lang.Throwable
public java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.lang.String getLocalizedMessage()
getMessage()
.
getLocalizedMessage
in class java.lang.Throwable
public void printStackTrace()
printStackTrace
in class java.lang.Throwable
public void printStackTrace(java.io.PrintStream s)
printStackTrace
in class java.lang.Throwable
s
- the print stream.public void printStackTrace(java.io.PrintWriter w)
printStackTrace
in class java.lang.Throwable
w
- the print writer.spublic void add(java.lang.Throwable t)
t
- The new exception (Throwable).public int size()
public java.util.Iterator iterator()
public void throwIfThrowable() throws java.lang.Throwable
java.lang.Throwable
- if the size of the list is not zero.public void throwIfException() throws java.lang.Exception
java.lang.Exception
- if the size of the list is not zero.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |