OntGenerationConfig { public boolean isPreferredForIdentifiers(CharSequence s, CharSequence other) { return isStringPreferred(s, other, identifierLangPreference); } OntGenerationConfig(); void setIdentifierLanguagePreference(List<String> preference); void setIdentifierLanguagePreference(String... preference); void setJavaDocLanguagePreference(List<String> preference); void setJavaDocLanguagePreference(String... preference); ValidatorChain getValidators(); void setValidators(ValidatorChain validators); boolean isIdentifierLanguagePreferred(String lang, String otherLang); boolean isPreferredForIdentifiers(CharSequence s, CharSequence other); boolean isJavaDocLanguagePreferred(String lang, String otherLang); boolean isPreferredForJavaDoc(CharSequence s, CharSequence other); Collection<DatatypeMapper> getDatatypeMappers(); void setDatatypeMappers(Collection<DatatypeMapper> datatypeMappers); void setDatatypeMappers(DatatypeMapper... datatypeMappers); boolean isRDFSLabelAmbiguityChecked(); void setRDFSLabelAmbiguityChecking(boolean checkRDFSLabelAmbiguity); boolean isFileOrFragmentAmbiguityChecked(); void setFileOrFragmentAmbiguityChecking(boolean checkFileOrFragmentAmbiguity); String getBasePackage(); void setBasePackage(String basePackage); boolean areAdderMethodsGenerated(); void useAdderMethodGeneration(boolean doGenerateAdder); boolean areAdderAllMethodsGenerated(); void useAdderAllMethodGeneration(boolean doGenerateAdderAll); boolean areRemoverMethodsGenerated(); void useRemoverMethodGeneration(boolean doGenerateRemover); boolean areRemoverAllMethodsGenerated(); void useRemoverAllMethodGeneration(boolean doGenerateRemoverAll); static final String UNTYPED_LITERAL; }
@Test public void isPreferredForIdentifiers() throws Exception { LangString english = new LangString("This is a test.", "en"); String untyped = "This is a test."; LangString italian = new LangString("Questo è un test", "it"); LangString french = new LangString("Ceci est un test", "fr"); assertTrue(config.isPreferredForIdentifiers(english, italian)); assertTrue(config.isPreferredForIdentifiers(untyped, italian)); assertFalse(config.isPreferredForIdentifiers(italian, english)); assertTrue(config.isPreferredForJavaDoc(english, null)); assertFalse(config.isPreferredForJavaDoc(french, null)); }