FileDocCategorySizeDatePackage
NestableRuntimeException.javaAPI DocHibernate 3.2.56555Fri Sep 09 10:21:10 BST 2005org.hibernate.exception

NestableRuntimeException

public class NestableRuntimeException extends RuntimeException implements Nestable
The base class of all runtime exceptions which can contain other exceptions.
author
Rafal Krzewski
author
Daniel Rall
author
Kasper Nielsen
author
Steven Caswell
version
$Id: NestableRuntimeException.java 8137 2005-09-09 15:21:10Z epbernard $
see
org.apache.commons.lang.exception.NestableException
since
1.0

Fields Summary
protected NestableDelegate
delegate
The helper instance which contains much of the code which we delegate to.
private Throwable
cause
Holds the reference to the exception or error that caused this exception to be thrown.
Constructors Summary
public NestableRuntimeException()
Constructs a new NestableRuntimeException without specified detail message.


	        	 
	  
		super();
	
public NestableRuntimeException(String msg)
Constructs a new NestableRuntimeException with specified detail message.

param
msg the error message

		super( msg );
	
public NestableRuntimeException(Throwable cause)
Constructs a new NestableRuntimeException with specified nested Throwable.

param
cause the exception or error that caused this exception to be thrown

		super();
		this.cause = cause;
	
public NestableRuntimeException(String msg, Throwable cause)
Constructs a new NestableRuntimeException with specified detail message and nested Throwable.

param
msg the error message
param
cause the exception or error that caused this exception to be thrown

		super( msg );
		this.cause = cause;
	
Methods Summary
public java.lang.ThrowablegetCause()

		return cause;
	
public java.lang.StringgetMessage()
Returns the detail message string of this throwable. If it was created with a null message, returns the following: ( cause==null ? null : cause.toString( ).

		if ( super.getMessage() != null ) {
			return super.getMessage();
		}
		else if ( cause != null ) {
			return cause.toString();
		}
		else {
			return null;
		}
	
public java.lang.StringgetMessage(int index)

		if ( index == 0 ) {
			return super.getMessage();
		}
		else {
			return delegate.getMessage( index );
		}
	
public java.lang.String[]getMessages()

		return delegate.getMessages();
	
public java.lang.ThrowablegetThrowable(int index)

		return delegate.getThrowable( index );
	
public intgetThrowableCount()

		return delegate.getThrowableCount();
	
public java.lang.Throwable[]getThrowables()

		return delegate.getThrowables();
	
public intindexOfThrowable(java.lang.Class type)

		return delegate.indexOfThrowable( type, 0 );
	
public intindexOfThrowable(java.lang.Class type, int fromIndex)

		return delegate.indexOfThrowable( type, fromIndex );
	
public final voidprintPartialStackTrace(java.io.PrintWriter out)

		super.printStackTrace( out );
	
public voidprintStackTrace()

		delegate.printStackTrace();
	
public voidprintStackTrace(java.io.PrintStream out)

		delegate.printStackTrace( out );
	
public voidprintStackTrace(java.io.PrintWriter out)

		delegate.printStackTrace( out );
	
private voidwriteObject(java.io.ObjectOutputStream oos)

		Throwable tempCause = cause;
		//don't propagate RecognitionException, might be not serializable
		if ( cause instanceof RecognitionException ) {
			cause = null;
		}
		oos.defaultWriteObject();
		cause = tempCause;