org.jboss.solder.exception.control
Class ExceptionStack

java.lang.Object
  extended by org.jboss.solder.exception.control.ExceptionStack
All Implemented Interfaces:
java.io.Serializable

public class ExceptionStack
extends java.lang.Object
implements java.io.Serializable

Information about the current exception and exception cause container. This object is not immutable.

See Also:
Serialized Form

Constructor Summary
  ExceptionStack()
          Basic constructor, needed to make the class a bean, please don't use
protected ExceptionStack(java.util.Collection<java.lang.Throwable> causeChainElements, int currentElementIndex)
          Deprecated. There shouldn't be a use for this, please use the other constructor
  ExceptionStack(java.lang.Throwable exception)
          Builds the stack from the given exception.
 
Method Summary
protected  void dropCause()
           
 java.util.Collection<java.lang.Throwable> getCauseElements()
           
 java.lang.Throwable getCurrent()
          Current exception in the iteration
 java.lang.Throwable getNext()
           
 java.util.Deque<ExceptionStackItem> getOrigExceptionStackItems()
          The original exception stack if it has been changed.
 java.util.Collection<java.lang.Throwable> getRemaining()
           
 boolean isLast()
          Test if iteration is finished
 boolean isRoot()
          Tests if the current exception is the root exception
 void setCauseElements(java.util.Collection<java.lang.Throwable> elements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionStack

public ExceptionStack()
Basic constructor, needed to make the class a bean, please don't use


ExceptionStack

public ExceptionStack(java.lang.Throwable exception)
Builds the stack from the given exception.

Parameters:
exception - Caught exception

ExceptionStack

@Deprecated
protected ExceptionStack(java.util.Collection<java.lang.Throwable> causeChainElements,
                                    int currentElementIndex)
Deprecated. There shouldn't be a use for this, please use the other constructor

Basic constructor.

Parameters:
causeChainElements - collection of all causing elements for an exception from top to bottom (not unwrapped).
currentElementIndex - index of current element within the causeChainElements.
Throws:
java.lang.IllegalArgumentException - if causeChainElements is empty or null.
Method Detail

getCauseElements

public java.util.Collection<java.lang.Throwable> getCauseElements()

isLast

public boolean isLast()
Test if iteration is finished

Returns:
finished with iteration

getNext

public java.lang.Throwable getNext()

getRemaining

public java.util.Collection<java.lang.Throwable> getRemaining()

isRoot

public boolean isRoot()
Tests if the current exception is the root exception

Returns:
Returns true if iteration is at the root exception (top of the inverted stack)

getCurrent

public java.lang.Throwable getCurrent()
Current exception in the iteration

Returns:
current exception

setCauseElements

public void setCauseElements(java.util.Collection<java.lang.Throwable> elements)

getOrigExceptionStackItems

public java.util.Deque<ExceptionStackItem> getOrigExceptionStackItems()
The original exception stack if it has been changed.

Returns:
The original exception stack

dropCause

protected void dropCause()


Copyright © 2008-2012 Seam Framework. All Rights Reserved.