net.sf.morph.util
Class NestableRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.morph.util.NestableRuntimeException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MorphException

public class NestableRuntimeException
extends java.lang.RuntimeException

A nestable runtime exception. Some documentation was copied directly from the documentation for the Throwable class in the Java SE 1.4 API.

Since:
November 6, 2004
Author:
Matthew Sgarlata
See Also:
Serialized Form

Constructor Summary
NestableRuntimeException()
          Constructs a new exception with null as its detail message.
NestableRuntimeException(java.lang.String message)
          Constructs a new exception with the specified detail message.
NestableRuntimeException(java.lang.String message, java.lang.Throwable cause)
          Constructs a new exception with the specified detail message and cause.
NestableRuntimeException(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
 java.lang.Throwable getCause()
           
 void getMessage(java.lang.StringBuffer sb)
           
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream out)
           
 void printStackTrace(java.io.PrintWriter out)
           
 void setCause(java.lang.Throwable cause)
          Initializes the cause of this throwable to the specified value.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NestableRuntimeException

public NestableRuntimeException()
Constructs a new exception with null as its detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(Throwable).


NestableRuntimeException

public NestableRuntimeException(java.lang.String message)
Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to Throwable.initCause(Throwable).

Parameters:
message - the detail message. The detail message is saved for later retrieval by the getCause() method.

NestableRuntimeException

public NestableRuntimeException(java.lang.String message,
                                java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the Throwable.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.)

NestableRuntimeException

public NestableRuntimeException(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). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, PrivilegedActionException ).

Parameters:
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

setCause

public void setCause(java.lang.Throwable cause)
Initializes the cause of this throwable to the specified value. (The cause is the throwable that caused this throwable to get thrown.)

This method can be called at most once. It is generally called from within the constructor, or immediately after creating the throwable. If this throwable was created with Throwable(Throwable) or Throwable(String,Throwable), this method cannot be called even once.

Parameters:
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.)

getCause

public java.lang.Throwable getCause()
Overrides:
getCause in class java.lang.Throwable

getMessage

public void getMessage(java.lang.StringBuffer sb)

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream out)
Overrides:
printStackTrace in class java.lang.Throwable
See Also:
Throwable.printStackTrace(java.io.PrintStream)

printStackTrace

public void printStackTrace(java.io.PrintWriter out)
Overrides:
printStackTrace in class java.lang.Throwable
See Also:
Throwable.printStackTrace(java.io.PrintWriter)


Copyright © 2004-2008.