org.apache.sis.internal.util.Utilities.appendUnicodeIdentifier()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.apache.sis.internal.util.Utilities.appendUnicodeIdentifier()方法的一些代码示例,展示了Utilities.appendUnicodeIdentifier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.appendUnicodeIdentifier()方法的具体详情如下:
包路径:org.apache.sis.internal.util.Utilities
类名称:Utilities
方法名:appendUnicodeIdentifier

Utilities.appendUnicodeIdentifier介绍

[英]Appends to the given buffer only the characters that are valid for a Unicode identifier. The given separator character is append before the given text only if the buffer is not empty and at least one text character is valid.

Relationship with gml:id
This method may be invoked for building gml:id values. Strictly speaking this is not appropriate since the xs:ID type defines valid identifiers as containing only letters, digits, underscores, hyphens, and periods. This differ from Unicode identifier in two ways:

  • Unicode identifiers accept Japanese or Chinese ideograms for instance, which are considered as letters.
  • Unicode identifiers do not accept the '-' and ':' characters. However this restriction fits well our need, since those characters are typical values for the separator argument.
  • Note that '_' is valid both in xs:ID and Unicode identifier.
    [中]仅将对Unicode标识符有效的字符附加到给定的缓冲区。仅当缓冲区不为空且至少有一个文本字符有效时,才会将给定分隔符追加到给定文本之前。
    与gml的关系:id
    可以调用此方法来构建gml:id值。严格来说,这是不合适的,因为xs:ID类型将有效标识符定义为只包含字母、数字、下划线、连字符和句点。这与Unicode标识符有两个不同之处:
    *Unicode标识符接受日文或中文表意文字,例如,它们被视为字母。
    *Unicode标识符不接受“-”和“:”字符。然而,这个限制非常适合我们的需要,因为这些字符是分隔符参数的典型值。
    *请注意,在xs:ID和Unicode标识符中,“x”都是有效的。

代码示例

代码示例来源:origin: org.apache.sis.core/sis-referencing

if (appendUnicodeIdentifier(id, '-', identifier.getCodeSpace(), "", true) |    // Really |, not ||
      appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(object.getClass()), "", false) |
      appendUnicodeIdentifier(id, '-', identifier.getCode(), "", true))
if (isUnnamed(name) || !appendUnicodeIdentifier(id, '-', name.getCode(), "", false)) {
  if (alias != null) {
    for (final GenericName a : alias) {
      if (appendUnicodeIdentifier(id, '-', a.toString(), "", false)) {
        break;

代码示例来源:origin: org.apache.sis.core/sis-metadata

if (id != null) {
  final StringBuilder buffer = new StringBuilder();
  if (!Utilities.appendUnicodeIdentifier(buffer, (char) 0, id, ":-", false)) {
    return null;

代码示例来源:origin: apache/sis

if (id != null) {
  final StringBuilder buffer = new StringBuilder();
  if (!Utilities.appendUnicodeIdentifier(buffer, (char) 0, id, ":-", false)) {
    return null;

代码示例来源:origin: apache/sis

if (appendUnicodeIdentifier(id, '-', identifier.getCodeSpace(), "", true) |    // Really |, not ||
      appendUnicodeIdentifier(id, '-', NameMeaning.toObjectType(object.getClass()), "", false) |
      appendUnicodeIdentifier(id, '-', identifier.getCode(), "", true))
if (isUnnamed(name) || !appendUnicodeIdentifier(id, '-', name.getCode(), "", false)) {
  if (alias != null) {
    for (final GenericName a : alias) {
      if (appendUnicodeIdentifier(id, '-', a.toString(), "", false)) {
        break;

代码示例来源:origin: org.apache.sis.core/sis-metadata

default: break loop;
if (!Utilities.appendUnicodeIdentifier(buffer.append(DefinitionURI.SEPARATOR), '\u0000', part, ".-", false)) {

代码示例来源:origin: apache/sis

default: break loop;
if (!Utilities.appendUnicodeIdentifier(buffer.append(DefinitionURI.SEPARATOR), '\u0000', part, ".-", false)) {

相关文章