Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » exception » [javadoc | source]
org.hibernate.exception
public class: NestableDelegate [javadoc | source]
java.lang.Object
   org.hibernate.exception.NestableDelegate

All Implemented Interfaces:
    Serializable

A shared implementation of the nestable exception functionality.

The code is shared between NestableError , NestableException and NestableRuntimeException .

Constructor:
 public NestableDelegate(Nestable nestable) 
    Constructs a new NestableDelegate instance to manage the specified Nestable.
    Parameters:
    nestable - the Nestable implementation (must extend java.lang.Throwable )
    since: 2.0 -
Method from org.hibernate.exception.NestableDelegate Summary:
getMessage,   getMessage,   getMessages,   getStackFrames,   getThrowable,   getThrowableCount,   getThrowables,   indexOfThrowable,   printStackTrace,   printStackTrace,   printStackTrace,   trimStackFrames
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.exception.NestableDelegate Detail:
 public String getMessage(int index) 
    Returns the error message of the Throwable in the chain of Throwables at the specified index, numbererd from 0.
 public String getMessage(String baseMsg) 
    Returns the full message contained by the Nestable and any nested Throwables.
 public 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 #getThrowableCount() operation.
 protected String[] getStackFrames(Throwable t) 
    Captures the stack trace associated with the specified Throwable object, decomposing it into a list of stack frames.
 public Throwable getThrowable(int index) 
    Returns the Throwable in the chain of Throwables at the specified index, numbererd from 0.
 public int getThrowableCount() 
    Returns the number of Throwables contained in the Nestable contained by this delegate.
 public Throwable[] getThrowables() 
    Returns this delegate's Nestable and any nested Throwables in an array of Throwables, one element for each Throwable.
 public int indexOfThrowable(Class type,
    int fromIndex) 
    Returns the index, numbered from 0, of the first Throwable that matches the specified type in the chain of Throwables held in this delegate's Nestable with an index greater than or equal to the specified index, or -1 if the type is not found.
 public  void printStackTrace() 
    Prints the stack trace of this exception the the standar error stream.
 public  void printStackTrace(PrintStream out) 
    Prints the stack trace of this exception to the specified stream.
 public  void printStackTrace(PrintWriter out) 
    Prints the stack trace of this exception to the specified writer. If the Throwable class has a getCause method (i.e. running on jre1.4 or higher), this method just uses Throwable's printStackTrace() method. Otherwise, generates the stack-trace, by taking into account the 'topDown' and 'trimStackFrames' parameters. The topDown and trimStackFrames are set to 'true' by default (produces jre1.4-like stack trace).
 protected  void trimStackFrames(List stacks) 
    Trims the stack frames. The first set is left untouched. The rest of the frames are truncated from the bottom by comparing with one just on top.