|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.util.AbstractExceptionBuilder<C,E>
C - The type of the cause exception.E - The type of the assembled exception.@NotThreadSafe public abstract class AbstractExceptionBuilder<C extends Exception,E extends Exception>
Abstract implementation of an exception builder.
Subclasses must implement update(Exception, Exception) and may
override post(Exception).
| Field Summary | |
|---|---|
private E |
assembly
|
| Constructor Summary | |
|---|---|
AbstractExceptionBuilder()
|
|
| Method Summary | |
|---|---|
void |
check()
Either returns or checks out and throws the result of the assembly in order to enable the assembly of another exception. |
private E |
checkout()
|
E |
fail(C cause)
Adds the cause exception to the assembly and
checks out and returns
the result
in order to enable the assembly of another exception. |
protected E |
post(E assembly)
This method is called to post-process the given result of the assembly after it has been checked out. |
protected abstract E |
update(C cause,
E previous)
This method is called to update the given previous result of
the assembly with the given cause. |
void |
warn(C cause)
Adds the cause exception to the assembly and
either returns or checks out and throws
the result
in order to enable the assembly of another exception. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private E extends Exception assembly
| Constructor Detail |
|---|
public AbstractExceptionBuilder()
| Method Detail |
|---|
protected abstract E update(C cause,
E previous)
previous result of
the assembly with the given cause.
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.cause - A(nother) non-null cause exception to add to the
assembly.
null is not permitted.protected E post(E assembly)
The implementation in the class AbstractExceptionBuilder simply
returns the parameter.
assembly - The checked out result of the exception assembly
- may be null.
null.private E checkout()
public final E fail(C cause)
cause exception to the assembly and
checks out and returns
the result
in order to enable the assembly of another exception.
Called to handle an exceptional condition which does not allow the caller to proceed its task. The implementation must return an appropriate exception to be thrown by the cooperative algorithm. Finally, if the implementation maintains a state, it must be updated so that this instance can be reused to handle more exceptions!
fail in interface ExceptionBuilder<C extends Exception,E extends Exception>fail in interface ExceptionHandler<C extends Exception,E extends Exception>cause - the exception to handle.
update(Exception, Exception),
post(Exception)public final void warn(C cause)
cause exception to the assembly and
either returns or checks out and throws
the result
in order to enable the assembly of another exception.
Called to handle an exceptional condition which
does
allow the caller to proceed its task.
The implementation may throw an exception of the parameter type
T or return from the call.
If the implementation maintains a state, it must be updated
so that this instance can be reused to handle more exceptions.
warn in interface ExceptionBuilder<C extends Exception,E extends Exception>warn in interface ExceptionHandler<C extends Exception,E extends Exception>cause - the exception to handle - null is not permitted.update(Exception, Exception)
public final void check()
throws E extends Exception
check in interface ExceptionBuilder<C extends Exception,E extends Exception>E extends Exceptionpost(Exception)
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||