Skip to content

Package: CommandParserProvider

CommandParserProvider

nameinstructionbranchcomplexitylinemethod
CommandParserProvider()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getCommandHelp()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCommandList()
M: 0 C: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getCommandTransform()
M: 0 C: 112
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 13
100%
M: 0 C: 1
100%
getCommandVersion()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCommandVocabulary()
M: 0 C: 90
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 10
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2020 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.owl2java.cli;
16:
17: import cz.cvut.kbss.jopa.owl2java.config.Defaults;
18: import joptsimple.OptionParser;
19:
20: import static cz.cvut.kbss.jopa.owl2java.cli.Option.*;
21:
22: public final class CommandParserProvider {
23:
24: private CommandParserProvider() {
25: throw new AssertionError();
26: }
27:
28: public static OptionParser getCommandHelp() {
29: return new OptionParser();
30: }
31:
32: public static OptionParser getCommandList() {
33: final ParamOptionParser p = new ParamOptionParser();
34: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
35: return p;
36: }
37:
38: public static OptionParser getCommandTransform() {
39: final ParamOptionParser p = new ParamOptionParser();
40: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
41: p.accepts(PACKAGE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PACKAGE);
42: p.accepts(CONTEXT).withRequiredArg().ofType(String.class);
43: p.accepts(WITH_IRIS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
44: p.accepts(TARGET_DIR).withRequiredArg().ofType(String.class).defaultsTo(Defaults.TARGET_DIR);
45: p.accepts(WHOLE_ONTOLOGY_AS_IC).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
46: p.accepts(IGNORE_FAILED_IMPORTS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
47: p.accepts(JAVA_CLASSNAME_ANNOTATION).withRequiredArg().ofType(String.class)
48: .defaultsTo(Defaults.JAVA_CLASSNAME_ANNOTATION);
49: p.accepts(PROPERTIES_TYPE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PROPERTIES_TYPE);
50: p.accepts(GENERATE_JAVADOC_FROM_COMMENT).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
51: return p;
52: }
53:
54: public static OptionParser getCommandVersion() {
55: return new OptionParser();
56: }
57:
58: public static OptionParser getCommandVocabulary() {
59: final ParamOptionParser p = new ParamOptionParser();
60: p.accepts(MAPPING_FILE).withRequiredArg().ofType(String.class);
61: p.accepts(PACKAGE).withRequiredArg().ofType(String.class).defaultsTo(Defaults.PACKAGE);
62: p.accepts(CONTEXT).withRequiredArg().ofType(String.class);
63: p.accepts(WITH_IRIS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
64: p.accepts(TARGET_DIR).withRequiredArg().ofType(String.class).defaultsTo(Defaults.TARGET_DIR);
65: p.accepts(WHOLE_ONTOLOGY_AS_IC).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
66: p.accepts(IGNORE_FAILED_IMPORTS).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
67: p.accepts(GENERATE_JAVADOC_FROM_COMMENT).withOptionalArg().ofType(Boolean.class).defaultsTo(true);
68: return p;
69: }
70: }