com.acsinet_solutions.util.exception
Class ExceptionData

java.lang.Object
  extended by com.acsinet_solutions.util.exception.ExceptionData

public final class ExceptionData
extends java.lang.Object

Wrapper for an exception object that enables nicer reporting of stack traces.

Author:
Santiago Arriaga

Constructor Summary
ExceptionData(java.lang.Throwable throwable)
          Constructor for an ExceptionData instance based on the given input throwable and no super exception
 
Method Summary
 java.lang.String getEntry(int i)
          Get the given stack trace entry
 int getFirstDifferentIndex()
          Get the first different index from it's outer stack trace
 ExceptionData getLastExceptionData()
          Get the last exception data of this nested exception structure
 java.lang.String getMessage()
          Return the not-null message for this throwable
 ExceptionData getNextExceptionData()
          Get the ExceptionData for a nested exception if any
 ExceptionData getPreviousExceptionData()
          Get the previous ExceptionData structure, if any
 int getSize()
          Get the size of the stack trace structure
 java.lang.Throwable getThrowable()
          Return the internal Throwable instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionData

public ExceptionData(java.lang.Throwable throwable)
Constructor for an ExceptionData instance based on the given input throwable and no super exception

Method Detail

getThrowable

public final java.lang.Throwable getThrowable()
Return the internal Throwable instance

Returns:
A not-null Throwable instance

getMessage

public final java.lang.String getMessage()
Return the not-null message for this throwable

Returns:
A not-null maybe-empty String instance

getSize

public final int getSize()
Get the size of the stack trace structure

Returns:
a nonegative int value

getFirstDifferentIndex

public final int getFirstDifferentIndex()
Get the first different index from it's outer stack trace

Returns:
A nonnegative int value. Zero if the current stack trace has nothing to do with the outer exception, other than zero if there is a branch somewhere

getEntry

public final java.lang.String getEntry(int i)
Get the given stack trace entry

Parameters:
An - int value greater than zero, less than the value reported by the getSize() method
Returns:
A not-null String instance

getNextExceptionData

public final ExceptionData getNextExceptionData()
Get the ExceptionData for a nested exception if any

Returns:
An ExceptionData instance if there is a nested exception; null otherwise

getPreviousExceptionData

public final ExceptionData getPreviousExceptionData()
Get the previous ExceptionData structure, if any


getLastExceptionData

public final ExceptionData getLastExceptionData()
Get the last exception data of this nested exception structure

Returns:
A not-null ExceptionData instance