|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.metamatrix.api.exception.MultipleRuntimeException
public class MultipleRuntimeException
MultipleRuntimeException is intended for situations where multiple, unrelated Throwables need to be thrown as a single RuntimeException. This is useful, for example, when an Exception is thrown in both the try and finally portions of a try- finally block. The Throwables are maintained within a list to allow them to be ordered by level of importance, with the first Throwable having the highest importance.
Constructor Summary | |
---|---|
MultipleRuntimeException()
Constructs an instance of this class with no message, a zero error code, and no Throwables. |
|
MultipleRuntimeException(java.util.List throwables)
Constructs an instance of this class with no message, a zero error code, and the specified set of Throwables. |
|
MultipleRuntimeException(java.lang.String message)
Constructs an instance of this class with the specified message, a zero error code, and no Throwables. |
|
MultipleRuntimeException(java.lang.String message,
java.util.List throwables)
Constructs an instance of this class with the specified message, a zero error code, and the specified set of Throwables. |
|
MultipleRuntimeException(java.lang.String message,
java.lang.String code)
Constructs an instance of this class with the specified message, the specified error code, and no Throwables. |
|
MultipleRuntimeException(java.lang.String message,
java.lang.String code,
java.util.List throwables)
Constructs an instance of this class with the specified message, the specified error code, and the specified set of Throwables. |
|
MultipleRuntimeException(java.lang.String message,
java.lang.String code,
java.lang.Throwable[] throwables)
Constructs an instance of this class with the specified message, the specified error code, and the specified set of Throwables. |
|
MultipleRuntimeException(java.lang.String message,
java.lang.Throwable[] throwables)
Constructs an instance of this class with the specified message, a zero error code, and the specified set of Throwables. |
|
MultipleRuntimeException(java.lang.Throwable[] throwables)
Constructs an instance of this class with no message, a zero error code, and the specified set of Throwables. |
Method Summary | |
---|---|
void |
addThrowable(java.lang.Throwable throwable)
Adds the specified Throwable to the list of Throwables that comprise this Exception. |
void |
addThrowable(java.lang.Throwable throwable,
int index)
Adds the specified Throwable to the list of Throwables that comprise this Exception at the specified index. |
protected void |
constructMultipleRuntimeException(java.lang.String code,
java.util.List throwables)
Constructs an instance of this class with the specified error code and the specified set of Throwables. |
java.lang.String |
getCode()
Returns the error code associated with this Exception. |
java.util.List |
getThrowables()
Returns the list of Throwables that comprise this Exception (Guaranteed not to be null). |
void |
setCode(java.lang.String code)
Sets the error code associated with this Exception. |
void |
setThrowables(java.util.List throwables)
Sets the list of Throwables that comprise this Exception. |
java.lang.String |
toString()
Overridden to return the concatentation of the toString() results from each of the Throwables within this Exception. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MultipleRuntimeException()
public MultipleRuntimeException(java.lang.String message)
message
- The message describing this Exceptionpublic MultipleRuntimeException(java.util.List throwables)
throwables
- The list of Throwables that comprise this Exceptionpublic MultipleRuntimeException(java.lang.Throwable[] throwables)
throwables
- The list of Throwables that comprise this Exceptionpublic MultipleRuntimeException(java.lang.String message, java.lang.String code)
message
- The message describing this Exceptioncode
- The error code associated with this Exceptionpublic MultipleRuntimeException(java.lang.String message, java.util.List throwables)
message
- The message describing this Exceptionthrowables
- The list of Throwables that comprise this Exceptionpublic MultipleRuntimeException(java.lang.String message, java.lang.Throwable[] throwables)
message
- The message describing this Exceptionthrowables
- The list of Throwables that comprise this Exceptionpublic MultipleRuntimeException(java.lang.String message, java.lang.String code, java.lang.Throwable[] throwables)
message
- The message describing this Exceptioncode
- The error code associated with this Exceptionthrowables
- The list of Throwables that comprise this Exceptionpublic MultipleRuntimeException(java.lang.String message, java.lang.String code, java.util.List throwables)
message
- The message describing this Exceptioncode
- The error code associated with this Exceptionthrowables
- The list of Throwables that comprise this ExceptionMethod Detail |
---|
public void addThrowable(java.lang.Throwable throwable)
throwable
- The Throwablepublic void addThrowable(java.lang.Throwable throwable, int index)
throwable
- The Throwableindex
- The index within the list of Throwables at which the Throwable should be addedprotected void constructMultipleRuntimeException(java.lang.String code, java.util.List throwables)
code
- The error code associated with this Exceptionthrowables
- The list of Throwables that comprise this Exceptionpublic java.lang.String getCode()
public java.util.List getThrowables()
public void setCode(java.lang.String code)
code
- The error code associated with this Exceptionpublic void setThrowables(java.util.List throwables)
throwables
- The list of Throwables that comprise this Exceptionpublic java.lang.String toString()
toString
in class java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |