OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 63 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 63 Rev 180
Line 13... Line 13...
13
 
13
 
14
 package org.openconcerto.utils.cc;
14
 package org.openconcerto.utils.cc;
15
 
15
 
16
import org.openconcerto.utils.ExceptionUtils;
16
import org.openconcerto.utils.ExceptionUtils;
17
 
17
 
18
import org.apache.commons.collections.Transformer;
-
 
19
 
-
 
20
/**
18
/**
21
 * Transformer able to throw an exception.
19
 * Transformer able to throw an exception.
22
 * 
20
 * 
23
 * @author Sylvain
21
 * @author Sylvain
24
 * 
22
 * 
25
 * @param <E> input type
23
 * @param <E> input type
26
 * @param <T> return type
24
 * @param <T> return type
27
 * @param <X> exception type
25
 * @param <X> exception type
28
 */
26
 */
29
public abstract class ExnTransformer<E, T, X extends Exception> implements Transformer, ITransformerExn<E, T, X> {
27
public abstract class ExnTransformer<E, T, X extends Exception> implements ITransformerExn<E, T, X> {
30
 
-
 
31
    @SuppressWarnings("unchecked")
-
 
32
    public final Object transform(Object input) {
-
 
33
        return this.transformCheckedWithExn((E) input, IllegalStateException.class);
-
 
34
    }
-
 
35
 
28
 
36
    /**
29
    /**
37
     * Execute this transformer, making sure that an exception of type <code>exnClass</code> is
30
     * Execute this transformer, making sure that an exception of type <code>exnClass</code> is
38
     * thrown.
31
     * thrown.
39
     * 
32
     *