public class OntGenerationConfig extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
UNTYPED_LITERAL
Pseudo language tag representing literals without
language information.
|
| Constructor and Description |
|---|
OntGenerationConfig()
Initializes the configuration with preference for untyped literals
for identifiers and JavaDoc.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areAdderAllMethodsGenerated() |
boolean |
areAdderMethodsGenerated() |
boolean |
areRemoverAllMethodsGenerated() |
boolean |
areRemoverMethodsGenerated() |
String |
getBasePackage()
Returns the package into which all generated Java files (within their respective packages) are
written to.
|
Collection<DatatypeMapper> |
getDatatypeMappers()
Returns the datatype mappers that are used to map RDF datatypes
(subclasses of
rdfs:Datatype) to Java types. |
ValidatorChain |
getValidators() |
boolean |
isFileOrFragmentAmbiguityChecked()
Identifier names for a resources are chosen from the suffix of its URI in absence of a RDFS label.
|
boolean |
isIdentifierLanguagePreferred(String lang,
String otherLang)
Checks whether a language
lang is preferred over another language
otherLang for building Java identifier names. |
boolean |
isJavaDocLanguagePreferred(String lang,
String otherLang)
Checks whether a language
lang is preferred over another language
otherLang for building JavaDocs. |
boolean |
isPreferredForIdentifiers(CharSequence s,
CharSequence other)
Checks whether a string - with or without language information (see
LangString) -
is preferred over another string by the language preference set for building identifier names. |
boolean |
isPreferredForJavaDoc(CharSequence s,
CharSequence other)
Checks whether a string - with or without language information (see
LangString) -
is preferred over another string by the language preference set for building JavaDoc. |
boolean |
isRDFSLabelAmbiguityChecked()
Identifier names for a resource are preferably chosen from its RDFS label (
rdfs:label). |
void |
setBasePackage(String basePackage)
Sets the package into which all generated Java files (within their respective packages) are
written to.
|
void |
setDatatypeMappers(Collection<DatatypeMapper> datatypeMappers)
Sets the datatype mappers that are used to map RDF datatypes
(subclasses of
rdfs:Datatype) to Java types. |
void |
setDatatypeMappers(DatatypeMapper... datatypeMappers)
Sets the datatype mappers that are used to map RDF datatypes
(subclasses of
rdfs:Datatype) to Java types. |
void |
setFileOrFragmentAmbiguityChecking(boolean checkFileOrFragmentAmbiguity)
Identifier names for a resources are chosen from the suffix of its URI in absence of a RDFS label.
|
void |
setIdentifierLanguagePreference(List<String> preference)
Sets the preference for languages when building Identifier names.
|
void |
setIdentifierLanguagePreference(String... preference)
Sets the preference for languages when building Identifier names.
|
void |
setJavaDocLanguagePreference(List<String> preference)
Sets the preference for languages when generating JavaDoc.
|
void |
setJavaDocLanguagePreference(String... preference)
Sets the preference for languages when building Identifier names.
|
void |
setRDFSLabelAmbiguityChecking(boolean checkRDFSLabelAmbiguity)
Identifier names for a resource are preferably chosen from its RDFS label (
rdfs:label). |
void |
setValidators(ValidatorChain validators) |
void |
useAdderAllMethodGeneration(boolean doGenerateAdderAll) |
void |
useAdderMethodGeneration(boolean doGenerateAdder) |
void |
useRemoverAllMethodGeneration(boolean doGenerateRemoverAll) |
void |
useRemoverMethodGeneration(boolean doGenerateRemover) |
public static final String UNTYPED_LITERAL
public OntGenerationConfig()
ValidatorChain.getRDFSDefault()).public void setIdentifierLanguagePreference(List<String> preference)
UNTYPED_LITERAL.
Note that the latter represents preference for
an untyped literal, i.e. a literal without language information.preference - The preference sequence to use for identifier names.public void setIdentifierLanguagePreference(String... preference)
UNTYPED_LITERAL.
Note that the latter represents preference for
an untyped literal, i.e. a literal without language information.preference - The preference sequence to use for identifier names.public void setJavaDocLanguagePreference(List<String> preference)
UNTYPED_LITERAL.
Note that the latter represents preference for
an untyped literal, i.e. a literal without language information.preference - The preference sequence to use for identifier names.public void setJavaDocLanguagePreference(String... preference)
UNTYPED_LITERAL.
Note that the latter represents preference for
an untyped literal, i.e. a literal without language information.preference - The preference sequence to use for identifier names.public ValidatorChain getValidators()
public void setValidators(ValidatorChain validators)
validators - The validator chain used for checking that arguments of resource object set- and add-methods
comply to the value space of their datatype.public boolean isIdentifierLanguagePreferred(String lang, String otherLang)
lang is preferred over another language
otherLang for building Java identifier names.
Note that the UNTYPED_LITERAL value for the language tags is allowed,
representing untyped literals.lang - The language to decide preference for. Must be a valid language tag
as defined in BCP47
or UNTYPED_LITERAL for unknown language.otherLang - The language to compare to. Must be a valid language tag
as defined in BCP47
or UNTYPED_LITERAL for unknown language.lang is preferred over otherLang
or it is in the preference list for identifier names and
otherLang is not. Returns false if lang is
not in the preference list.public boolean isPreferredForIdentifiers(CharSequence s, CharSequence other)
LangString) -
is preferred over another string by the language preference set for building identifier names.s - The string to decide preference for.other - The string to compare to.s is preferred over the one of
other or its language is in the preference list for building identifier names and the
one of other is not. Returns false if the language of s is not
in the preference list.public boolean isJavaDocLanguagePreferred(String lang, String otherLang)
lang is preferred over another language
otherLang for building JavaDocs.
Note that the UNTYPED_LITERAL value for the language tags is allowed,
representing untyped literals.lang - The language to decide preference for. Must be a valid language tag
as defined in BCP47
or UNTYPED_LITERAL for unknown language.otherLang - The language to compare to. Must be a valid language tag
as defined in BCP47
or UNTYPED_LITERAL for unknown language.lang is preferred over otherLang
or it is in the preference list for JavaDocs and
otherLang is not. Returns false if lang is
not in the preference list.public boolean isPreferredForJavaDoc(CharSequence s, CharSequence other)
LangString) -
is preferred over another string by the language preference set for building JavaDoc.s - The string to decide preference for.other - The string to compare to.s is preferred over the one of
other or its language is in the preference list for building JavaDocs and the
one of other is not. Returns false if the language of s is not
in the preference list.public Collection<DatatypeMapper> getDatatypeMappers()
rdfs:Datatype) to Java types.public void setDatatypeMappers(Collection<DatatypeMapper> datatypeMappers)
rdfs:Datatype) to Java types.datatypeMappers - The mappers to be used during Java file generation.public void setDatatypeMappers(DatatypeMapper... datatypeMappers)
rdfs:Datatype) to Java types.datatypeMappers - The mappers to be used during Java file generation.public boolean isRDFSLabelAmbiguityChecked()
rdfs:label).
If the ambiguity check is enabled all other labels will be checked for being possibly in conflict
when a identifier name is generated, i.e. would result in the same identifier name.
In case of a conflict the identifier is picked from the resources URI (also see
isFileOrFragmentAmbiguityChecked()) for this.public void setRDFSLabelAmbiguityChecking(boolean checkRDFSLabelAmbiguity)
rdfs:label).
If the ambiguity check is enabled all other labels will be checked for being possibly in conflict
when a identifier name is generated, i.e. would result in the same identifier name.
In case of a conflict the identifier is picked from the resources URI (also see
isFileOrFragmentAmbiguityChecked()) for this.checkRDFSLabelAmbiguity - Whether to perform the above check and fallback mechanism.public boolean isFileOrFragmentAmbiguityChecked()
IdentifierBuilder for this.
http://example.de/ont#Main_Dish and http://example.de/ont#MainDish.
If the ambiguity check is turned off, the generated classes will both be named MainDish which
will lead to Java compile errors.
If the check is enabled the class names will receive an unique number so they can be distinguished.public void setFileOrFragmentAmbiguityChecking(boolean checkFileOrFragmentAmbiguity)
IdentifierBuilder for this.
http://example.de/ont#Main_Dish and http://example.de/ont#MainDish.
If the ambiguity check is turned off, the generated classes will both be named MainDish which
will lead to Java compile errors.
If the check is enabled the class names will receive an unique number so they can be distinguished.checkFileOrFragmentAmbiguity - Whether the above check should be turned on.public String getBasePackage()
com.yourproject.model
specify the base package that way and JavaFileGenerator
will write Java files into subpackages (determined by the class URIs) and adopt the package declaration within
the source files, e.g. package com.yourproject.model.org.dbpedia.public void setBasePackage(String basePackage)
com.yourproject.model
specify the base package that way and JavaFileGenerator
will write Java files into subpackages (determined by the class URIs) and adopt the package declaration within
the source files, e.g. package com.yourproject.model.org.dbpedia.basePackage - The base package.public boolean areAdderMethodsGenerated()
public void useAdderMethodGeneration(boolean doGenerateAdder)
doGenerateAdder - Whether methods for adding a single value to the value set of an objects property should be generated.public boolean areAdderAllMethodsGenerated()
public void useAdderAllMethodGeneration(boolean doGenerateAdderAll)
doGenerateAdderAll - Whether methods for adding a multiple values to the value set of an objects property should be generated.public boolean areRemoverMethodsGenerated()
public void useRemoverMethodGeneration(boolean doGenerateRemover)
doGenerateRemover - Whether methods for removing a single value from the value set of an objects property should be generated.public boolean areRemoverAllMethodsGenerated()
public void useRemoverAllMethodGeneration(boolean doGenerateRemoverAll)
doGenerateRemoverAll - Whether methods for removing a multiple values from the value set of an objects property should be generated.Copyright © 2017 Chair of Distributed Information Systems - University of Passau. All rights reserved.