Skip to contentPackage: CommandParserProvider
CommandParserProvider
Coverage
1: package cz.cvut.kbss.jopa.owl2java.cli;
2:
3: import cz.cvut.kbss.jopa.owl2java.config.Defaults;
4: import joptsimple.OptionParser;
5:
6: import static cz.cvut.kbss.jopa.owl2java.cli.Option.*;
7:
8: public final class CommandParserProvider {
9:
10: private CommandParserProvider() {
11: throw new AssertionError();
12: }
13:
14: public static OptionParser getCommandHelp() {
15: return new OptionParser();
16: }
17:
18: public static OptionParser getCommandList() {
19: final ParamOptionParser p = new ParamOptionParser();
20: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
21: return p;
22: }
23:
24: public static OptionParser getCommandTransform() {
25: final ParamOptionParser p = new ParamOptionParser();
26: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
27: p.accepts(PACKAGE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PACKAGE);
28: p.accepts(CONTEXT).withRequiredArg().ofType(String.class);
29: p.accepts(WITH_IRIS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
30: p.accepts(TARGET_DIR).withRequiredArg().ofType(String.class).defaultsTo(Defaults.TARGET_DIR);
31: p.accepts(WHOLE_ONTOLOGY_AS_IC).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
32: p.accepts(IGNORE_FAILED_IMPORTS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
33: p.accepts(JAVA_CLASSNAME_ANNOTATION).withRequiredArg().ofType(String.class)
34: .defaultsTo(Defaults.JAVA_CLASSNAME_ANNOTATION);
35: p.accepts(PROPERTIES_TYPE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PROPERTIES_TYPE);
36: p.accepts(GENERATE_JAVADOC_FROM_COMMENT).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
37: return p;
38: }
39:
40: public static OptionParser getCommandVersion() {
41: return new OptionParser();
42: }
43:
44: public static OptionParser getCommandVocabulary() {
45: final ParamOptionParser p = new ParamOptionParser();
46: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
47: p.accepts(PACKAGE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PACKAGE);
48: p.accepts(CONTEXT).withRequiredArg().ofType(String.class);
49: p.accepts(WITH_IRIS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
50: p.accepts(TARGET_DIR).withRequiredArg().ofType(String.class).defaultsTo(Defaults.TARGET_DIR);
51: p.accepts(WHOLE_ONTOLOGY_AS_IC).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
52: p.accepts(IGNORE_FAILED_IMPORTS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
53: p.accepts(GENERATE_JAVADOC_FROM_COMMENT).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
54: return p;
55: }
56: }