de.schlichtherle.truezip.io
Class SequentialIOExceptionBuilder<C extends Exception,E extends SequentialIOException>
java.lang.Object
de.schlichtherle.truezip.util.AbstractExceptionBuilder<C,E>
de.schlichtherle.truezip.io.SequentialIOExceptionBuilder<C,E>
- Type Parameters:
C - The type of the cause exception.E - The type of the assembled exception.
- All Implemented Interfaces:
- ExceptionBuilder<C,E>, ExceptionHandler<C,E>
- Direct Known Subclasses:
- FsSyncExceptionBuilder
@NotThreadSafe
public class SequentialIOExceptionBuilder<C extends Exception,E extends SequentialIOException>
- extends AbstractExceptionBuilder<C,E>
Assembles a SequentialIOException from one or more Exceptions by
chaining
them.
When the assembly is thrown or returned later, it is sorted by
priority.
- Author:
- Christian Schlichtherle
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
clazz
private final Class<E extends SequentialIOException> clazz
SequentialIOExceptionBuilder
public SequentialIOExceptionBuilder(Class<C> c,
Class<E> e)
create
public static SequentialIOExceptionBuilder<SequentialIOException,SequentialIOException> create()
- Static constructor provided for comforting the most prominent use case.
update
protected final E update(C cause,
E previous)
- Chains the given exceptions and returns the result.
- Specified by:
update in class AbstractExceptionBuilder<C extends Exception,E extends SequentialIOException>
- Parameters:
cause - A(nother) non-null cause exception to add to the
assembly.previous - The previous result of the assembly or null if
this is the first call since the creation of this instance or the
last assembly has been checked out.
- Returns:
- The assembled exception.
null is not permitted.
- Throws:
IllegalStateException - if
cause.SequentialIOException.getPredecessor() is
already initialized by a previous call to
SequentialIOException.initPredecessor(SequentialIOException).
post
protected final E post(E assembly)
- This method is called to post-process the given result of the assembly
after it has been checked out.
The implementation in the class AbstractExceptionBuilder simply
returns the parameter.
Sorts the given exception chain by
priority
and returns the result.
- Overrides:
post in class AbstractExceptionBuilder<C extends Exception,E extends SequentialIOException>
- Parameters:
assembly - The checked out result of the exception assembly
- may be null.
- Returns:
- The post-processed checked out result of the exception assembly
- may be
null.
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.