1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
package com.lexicalscope.jewel.cli; |
16 | |
|
17 | |
import static com.lexicalscope.fluentreflection.FluentReflection.type; |
18 | |
|
19 | |
import com.lexicalscope.fluentreflection.FluentClass; |
20 | |
import com.lexicalscope.jewel.cli.specification.OptionsSpecification; |
21 | |
|
22 | |
class CliInterfaceImpl<O> extends AbstractCliImpl<O> { |
23 | |
public CliInterfaceImpl(final Class<O> options) { |
24 | 212 | this(type(options)); |
25 | 210 | } |
26 | |
|
27 | |
public CliInterfaceImpl(final FluentClass<O> type) { |
28 | 212 | super(type, createOptionSpecification(type)); |
29 | 210 | } |
30 | |
|
31 | |
private static <O> OptionsSpecification<O> createOptionSpecification(final FluentClass<O> klass) { |
32 | 212 | return InterfaceOptionsSpecificationParser.<O>createOptionsSpecificationImpl(klass); |
33 | |
} |
34 | |
|
35 | |
@Override protected ArgumentPresenterImpl<O> argumentPresenter( |
36 | |
final FluentClass<O> klass, |
37 | |
final OptionsSpecification<O> specification) { |
38 | 190 | return new ArgumentPresenterImpl<O>(specification, new InterfaceArgumentPresentingStrategy<O>(klass)); |
39 | |
} |
40 | |
} |