FileDocCategorySizeDatePackage
Nestable.javaAPI DocHibernate 3.2.58106Sat Nov 20 17:11:28 GMT 2004org.hibernate.exception

Nestable

public interface Nestable
An interface to be implemented by {@link java.lang.Throwable} extensions which would like to be able to nest root exceptions inside themselves.
author
Daniel Rall
author
Kasper Nielsen
author
Steven Caswell
author
Pete Gieser
version
$Id: Nestable.java 4782 2004-11-21 00:11:27Z pgmjsd $
since
1.0

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ThrowablegetCause()
Returns the reference to the exception or error that caused the exception implementing the Nestable to be thrown.

return
throwable that caused the original exception

public java.lang.StringgetMessage()
Returns the error message of this and any nested Throwable.

return
the error message

public java.lang.StringgetMessage(int index)
Returns the error message of the Throwable in the chain of Throwables at the specified index, numbererd from 0.

param
index the index of the Throwable in the chain of Throwables
return
the error message, or null if the Throwable at the specified index in the chain does not contain a message
throws
IndexOutOfBoundsException if the index argument is negative or not less than the count of Throwables in the chain

public java.lang.String[]getMessages()
Returns the error message of this and any nested Throwables in an array of Strings, one element for each message. Any Throwable not containing a message is represented in the array by a null. This has the effect of cause the length of the returned array to be equal to the result of the {@link #getThrowableCount()} operation.

return
the error messages

public java.lang.ThrowablegetThrowable(int index)
Returns the Throwable in the chain of Throwables at the specified index, numbererd from 0.

param
index the index, numbered from 0, of the Throwable in the chain of Throwables
return
the Throwable
throws
IndexOutOfBoundsException if the index argument is negative or not less than the count of Throwables in the chain

public intgetThrowableCount()
Returns the number of nested Throwables represented by this Nestable, including this Nestable.

return
the throwable count

public java.lang.Throwable[]getThrowables()
Returns this Nestable and any nested Throwables in an array of Throwables, one element for each Throwable.

return
the Throwables

public intindexOfThrowable(java.lang.Class type)
Returns the index, numbered from 0, of the first occurrence of the specified type in the chain of Throwables, or -1 if the specified type is not found in the chain.

param
type Class to be found
return
index of the first occurrence of the type in the chain, or -1 if the type is not found

public intindexOfThrowable(java.lang.Class type, int fromIndex)
Returns the index, numbered from 0, of the first Throwable that matches the specified type in the chain of Throwables with an index greater than or equal to the specified index, or -1 if the type is not found.

param
type Class to be found
param
fromIndex the index, numbered from 0, of the starting position in the chain to be searched
return
index of the first occurrence of the type in the chain, or -1 if the type is not found
throws
IndexOutOfBoundsException if the fromIndex argument is negative or not less than the count of Throwables in the chain

public voidprintPartialStackTrace(java.io.PrintWriter out)
Prints the stack trace for this exception only--root cause not included--using the provided writer. Used by {@link org.apache.commons.lang.exception.NestableDelegate} to write individual stack traces to a buffer. The implementation of this method should call super.printStackTrace(out); in most cases.

param
out The writer to use.

public voidprintStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified print writer. Includes information from the exception, if any, which caused this exception.

param
out PrintWriter to use for output.

public voidprintStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified print stream. Includes inforamation from the exception, if any, which caused this exception.

param
out PrintStream to use for output.