Skip to content

Commit

Permalink
[Enhancement #170] Add option to disable generation of label and desc…
Browse files Browse the repository at this point in the history
…ription fields to JOPA Maven plugin.
  • Loading branch information
ledsoft committed Jun 6, 2023
1 parent 9adfbaf commit 4cf9470
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -37,6 +37,7 @@ public class OWL2JavaMojo extends AbstractMojo {
private static final String PROPERTIES_TYPE = "properties-type";
private static final String GENERATE_JAVADOC = "javadoc-from-rdfs-comment";
private static final String PREFER_MULTILINGUAL_STRINGS = "prefer-multilingual-strings";
private static final String GENERATE_ANNOTATION_FIELDS = "generate-annotation-fields";

@Parameter(alias = MAPPING_FILE_PARAM)
private String pMappingFile;
Expand Down Expand Up @@ -74,6 +75,9 @@ public class OWL2JavaMojo extends AbstractMojo {
@Parameter(alias = PREFER_MULTILINGUAL_STRINGS, defaultValue = "true")
private boolean preferMultilingualStrings;

@Parameter(alias = GENERATE_ANNOTATION_FIELDS, defaultValue = "true")
private boolean generateAnnotationFields;

@Override
public void execute() {
OWL2JavaTransformer owl2java = new OWL2JavaTransformer();
Expand Down Expand Up @@ -105,7 +109,8 @@ public void execute() {

final TransformationConfiguration config =
builder.packageName(pPackage).targetDir(pOutputDirectory).addOwlapiIris(pWithOWLAPI)
.generateJavadoc(generateJavadoc).preferMultilingualStrings(preferMultilingualStrings).build();
.generateJavadoc(generateJavadoc).preferMultilingualStrings(preferMultilingualStrings)
.generateLabelDescriptionFields(generateAnnotationFields).build();

if (pVocabularyOnly) {
owl2java.generateVocabulary(config);
Expand All @@ -129,6 +134,7 @@ private void printParameterValues() {
print(PROPERTIES_TYPE,pPropertiesType);
print(GENERATE_JAVADOC, generateJavadoc);
print(PREFER_MULTILINGUAL_STRINGS, preferMultilingualStrings);
print(GENERATE_ANNOTATION_FIELDS, generateAnnotationFields);
}

private void print(String param, Object value) {
Expand Down

0 comments on commit 4cf9470

Please sign in to comment.