Skip to content

Package: Option

Option

nameinstructionbranchcomplexitylinemethod
Option(String, int, String, String)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
static {...}
M: 0 C: 124
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 11
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: /**
18: * Command line options for configuring the transformation/vocabulary generation.
19: */
20: public enum Option {
21: /**
22: * Mapping file path.
23: * <p>
24: * Mapping file allows to map logical ontology IRI to its physical location (e.g. IRI to a local file path)
25: */
26: MAPPING_FILE("m", "mapping file"),
27: /**
28: * Name of context which should be processed by the tool.
29: * <p>
30: * Context is specified by annotating an axiom with {@link cz.cvut.kbss.jopa.owl2java.Constants#P_IS_INTEGRITY_CONSTRAINT_FOR}
31: * containing the name of the context. When it is specified, only axioms annotated with the context name are
32: * considered for transformation/vocabulary generation.
33: */
34: CONTEXT("c", "context name"),
35: /**
36: * Whether to generate vocabulary constants as instances of OWLAPI {@link org.semanticweb.owlapi.model.IRI}.
37: * <p>
38: * By default, they are String.
39: */
40: WITH_IRIS("w", "with OWLAPI IRIs"),
41: /**
42: * Output directory name.
43: * <p>
44: * Note that the generator will create subdirectories corresponding to the package into which the target classes are
45: * generated.
46: */
47: TARGET_DIR("d", "output directory"),
48: /**
49: * Target package for the generated classes.
50: * <p>
51: * Note that when generating the model, a {@link cz.cvut.kbss.jopa.owl2java.Constants#MODEL_PACKAGE} subpackage is
52: * put into the configured package for model classes. E.g., when generating into {@code cz.cvut.kbss}, the {@code
53: * Vocabulary} will be in this package, but the model classes will be in {@code cz.cvut.kbss.model}.
54: */
55: PACKAGE("p", "package"),
56: /**
57: * Whether to interpret the whole ontology as integrity constraints.
58: * <p>
59: * This supersedes {@link #CONTEXT} and processes all axioms in the ontology.
60: */
61: WHOLE_ONTOLOGY_AS_IC("i",
62: "interpret whole ontology as integrity constraints; this option supersedes the '-c' option."),
63: /**
64: * Whether to ignore failed imports.
65: * <p>
66: * By default, the transformation/vocabulary generation will fail if an import cannot be resolved.
67: */
68: IGNORE_FAILED_IMPORTS("f", "ignore failed ontology imports"),
69: /**
70: * Configures annotation whose value should be used as name of the target Java class.
71: * <p>
72: * By default, the Java class name is derived from the class IRI.
73: */
74: JAVA_CLASSNAME_ANNOTATION("jca", "java class name annotation"),
75: /**
76: * Generic type of the {@link cz.cvut.kbss.jopa.model.annotations.Properties} attribute.
77: * <p>
78: * Possible options are {@link PropertiesType#string} for {@code <String, Set<String>>} or {@link
79: * PropertiesType#object} for {@code <String, Set<Object>>}.
80: */
81: PROPERTIES_TYPE("pt", "type of the @Properties map value set - String (default), Object"),
82: /**
83: * Whether to generate Javadoc from values of {@code rdfs:comment} annotations.
84: * <p>
85: * By default, OWL2Java will generate Javadoc from the first rdfs:comment it finds for each axioms. This leads to
86: * documentation being created for classes, their attributes and vocabulary constants.
87: */
88: GENERATE_JAVADOC_FROM_COMMENT("doc", "generate Javadoc from rdfs:comment annotations");
89:
90: public final String arg;
91: final String description;
92:
93: Option(String arg, String description) {
94: this.arg = arg;
95: this.description = description;
96: }
97: }