com.android.jack.api.v01
Class ChainedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.android.jack.api.v01.ChainedException
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<ChainedException>
Direct Known Subclasses:
ConfigurationException

public abstract class ChainedException
extends java.lang.Exception
implements java.lang.Iterable<ChainedException>

Abstract class to easily chain exceptions together. The exception can be managed like any other exception. In this case, the first one will be the only one used. Special management can use the iterator() or the getNextException() to browse all chained exceptions and dispatch them. See ChainedException.ChainedExceptionBuilder to build the chain of exceptions.

See Also:
Serialized Form

Nested Class Summary
static class ChainedException.ChainedExceptionBuilder<T extends ChainedException>
          Builder to construct a chain of exceptions.
 
Constructor Summary
ChainedException(java.lang.String message)
           
ChainedException(java.lang.String message, java.lang.Throwable cause)
           
ChainedException(java.lang.Throwable cause)
           
 
Method Summary
 java.lang.String getLocalizedMessage()
           
 java.lang.String getMessage()
           
 ChainedException getNextException()
           
 int getNextExceptionCount()
           
 java.util.Iterator<ChainedException> iterator()
           
protected  ChainedException putAsLastExceptionOf(ChainedException head)
           
 void setMessage(java.lang.String message)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedException

public ChainedException(@Nonnull
                        java.lang.String message)

ChainedException

public ChainedException(@Nonnull
                        java.lang.String message,
                        @Nonnull
                        java.lang.Throwable cause)

ChainedException

public ChainedException(@Nonnull
                        java.lang.Throwable cause)
Method Detail

getMessage

@Nonnull
public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable

getLocalizedMessage

@Nonnull
public java.lang.String getLocalizedMessage()
Overrides:
getLocalizedMessage in class java.lang.Throwable

setMessage

public void setMessage(@Nonnull
                       java.lang.String message)

putAsLastExceptionOf

@Nonnull
protected ChainedException putAsLastExceptionOf(@CheckForNull
                                                        ChainedException head)

getNextException

@CheckForNull
public ChainedException getNextException()

getNextExceptionCount

@Nonnegative
public int getNextExceptionCount()

iterator

@Nonnull
public java.util.Iterator<ChainedException> iterator()
Specified by:
iterator in interface java.lang.Iterable<ChainedException>