本文整理了Java中org.eclipse.rdf4j.model.util.Literals.normalizeLanguageTag()
方法的一些代码示例,展示了Literals.normalizeLanguageTag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Literals.normalizeLanguageTag()
方法的具体详情如下:
包路径:org.eclipse.rdf4j.model.util.Literals
类名称:Literals
方法名:normalizeLanguageTag
[英]Normalizes the given BCP47 language tag according to the rules defined by the JDK in the Locale API.
[中]根据JDK在LocaleAPI中定义的规则规范化给定的BCP47语言标记。
代码示例来源:origin: eclipse/rdf4j
@Override
public boolean isRecognizedLanguage(String languageTag) {
Objects.requireNonNull(languageTag, "Language tag cannot be null");
try {
Literals.normalizeLanguageTag(languageTag);
}
catch (IllformedLocaleException e) {
return false;
}
return true;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
@Override
public boolean isRecognizedLanguage(String languageTag) {
Objects.requireNonNull(languageTag, "Language tag cannot be null");
try {
Literals.normalizeLanguageTag(languageTag);
}
catch (IllformedLocaleException e) {
return false;
}
return true;
}
代码示例来源:origin: org.eclipse.rdf4j/rdf4j-client
@Override
public Literal normalizeLanguage(String literalValue, String languageTag, ValueFactory valueFactory)
throws LiteralUtilException
{
Objects.requireNonNull(languageTag, "Language tag cannot be null");
Objects.requireNonNull(literalValue, "Literal value cannot be null");
try {
return valueFactory.createLiteral(literalValue, Literals.normalizeLanguageTag(languageTag));
}
catch (IllformedLocaleException e) {
throw new LiteralUtilException("Could not normalize BCP47 language tag", e);
}
}
代码示例来源:origin: eclipse/rdf4j
@Override
public Literal normalizeLanguage(String literalValue, String languageTag, ValueFactory valueFactory)
throws LiteralUtilException
{
Objects.requireNonNull(languageTag, "Language tag cannot be null");
Objects.requireNonNull(literalValue, "Literal value cannot be null");
try {
return valueFactory.createLiteral(literalValue, Literals.normalizeLanguageTag(languageTag));
}
catch (IllformedLocaleException e) {
throw new LiteralUtilException("Could not normalize BCP47 language tag", e);
}
}
内容来源于网络,如有侵权,请联系作者删除!