1 | |
package com.lexicalscope.jewel.cli; |
2 | |
|
3 | |
import com.lexicalscope.fluentreflection.FluentClass; |
4 | |
import com.lexicalscope.fluentreflection.FluentMethod; |
5 | |
import com.lexicalscope.jewel.cli.specification.ParsedOptionSpecification; |
6 | |
import com.lexicalscope.jewel.cli.specification.UnparsedOptionSpecification; |
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
class AbstractConvertMethodToOptionSpecification { |
25 | |
protected final FluentClass<?> klass; |
26 | |
|
27 | 580 | public AbstractConvertMethodToOptionSpecification(final FluentClass<?> klass) { |
28 | 580 | this.klass = klass; |
29 | 580 | } |
30 | |
|
31 | |
protected UnparsedOptionSpecification createUnparsedOptionSpecificationFrom( |
32 | |
final FluentMethod method) { |
33 | |
|
34 | 60 | return new UnparsedOptionSpecificationImpl(new UnparsedAnnotationAdapter(klass, method, method.annotation(Unparsed.class))); |
35 | |
} |
36 | |
|
37 | |
protected ParsedOptionSpecification createParsedOptionSpecificationFrom(final FluentMethod method) { |
38 | 514 | return new ParsedOptionSpecificationImpl(new OptionAnnotationAdapter(klass, method)); |
39 | |
} |
40 | |
} |