File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/main/java/org/scijava/convert Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ package org .scijava .convert ;
3
+
4
+ import org .scijava .plugin .Parameter ;
5
+
6
+ /**
7
+ * Abstract superclass for {@link Converter} plugins that delegate to other
8
+ * converters to chain two conversion steps together.
9
+ *
10
+ * @author Jan Eglinger
11
+ * @param <I> the input type
12
+ * @param <D> the delegate type
13
+ * @param <O> the output type
14
+ */
15
+ public abstract class AbstractDelegateConverter <I , D , O > extends
16
+ AbstractConverter <I , O >
17
+ {
18
+
19
+ @ Parameter
20
+ private ConvertService convertService ;
21
+
22
+ @ Override
23
+ public <T > T convert (Object src , Class <T > dest ) {
24
+ D delegate = convertService .convert (src , getDelegateType ());
25
+ return convertService .convert (delegate , dest );
26
+ }
27
+
28
+ protected abstract Class <D > getDelegateType ();
29
+ }
You can’t perform that action at this time.
0 commit comments