OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 17 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 83
Line 19... Line 19...
19
 * @author Sylvain
19
 * @author Sylvain
20
 * 
20
 * 
21
 * @param <E> input type
21
 * @param <E> input type
22
 * @param <X> exception type
22
 * @param <X> exception type
23
 */
23
 */
24
public abstract class ExnClosure<E, X extends Exception> extends ExnTransformer<E, Object, X> {
24
public abstract class ExnClosure<E, X extends Exception> extends ExnTransformer<E, Object, X> implements IExnClosure<E, X> {
25
 
25
 
26
    public final void execute(Object input) {
26
    public final void execute(Object input) {
27
        this.transform(input);
27
        this.transform(input);
28
    }
28
    }
29
 
29
 
30
    /**
30
    /**
31
     * Execute this closure, making sure that an exception of type <code>exnClass</code> is
31
     * Execute this closure, making sure that an exception of type <code>exnClass</code> is thrown.
32
     * thrown.
-
 
33
     * 
32
     * 
34
     * @param <Y> type of exception to throw.
33
     * @param <Y> type of exception to throw.
35
     * @param input the input of the closure.
34
     * @param input the input of the closure.
36
     * @param exnClass class exception to throw.
35
     * @param exnClass class exception to throw.
37
     * @throws Y if {@link #executeChecked(Object)} throws an exception, it will be wrapped (if
36
     * @throws Y if {@link #executeChecked(Object)} throws an exception, it will be wrapped (if
Line 45... Line 44...
45
    public final Object transformChecked(E input) throws X {
44
    public final Object transformChecked(E input) throws X {
46
        this.executeChecked(input);
45
        this.executeChecked(input);
47
        return null;
46
        return null;
48
    }
47
    }
49
 
48
 
-
 
49
    @Override
50
    public abstract void executeChecked(E input) throws X;
50
    public abstract void executeChecked(E input) throws X;
51
}
51
}