当前位置: 首页>>代码示例>>Java>>正文


Java Signature.C_DOT属性代码示例

本文整理汇总了Java中org.eclipse.jdt.core.Signature.C_DOT属性的典型用法代码示例。如果您正苦于以下问题:Java Signature.C_DOT属性的具体用法?Java Signature.C_DOT怎么用?Java Signature.C_DOT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.core.Signature的用法示例。


在下文中一共展示了Signature.C_DOT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendClassTypeSignature

private static void appendClassTypeSignature(
    char[] string, int start, StringBuffer buffer, boolean compact) {
  char c = string[start];
  if (c != Signature.C_RESOLVED) {
    return;
  }
  int p = start + 1;
  int checkpoint = buffer.length();
  while (true) {
    c = string[p];
    switch (c) {
      case Signature.C_SEMICOLON:
        // all done
        return;
      case Signature.C_DOT:
      case '/':
        // erase package prefix
        if (compact) {
          buffer.setLength(checkpoint);
        } else {
          buffer.append('.');
        }
        break;
      case Signature.C_DOLLAR:
        /**
         * Convert '$' in resolved type signatures into '.'. NOTE: This assumes that the type
         * signature is an inner type signature. This is true in most cases, but someone can
         * define a non-inner type name containing a '$'.
         */
        buffer.append('.');
        break;
      default:
        buffer.append(c);
    }
    p++;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:Util.java

示例2: appendClassTypeSignatureForAnchor

private static int appendClassTypeSignatureForAnchor(
    char[] string, int start, StringBuffer buffer) {
  // need a minimum 3 chars "Lx;"
  if (start >= string.length - 2) {
    throw new IllegalArgumentException();
  }
  // must start in "L" or "Q"
  char c = string[start];
  if (c != Signature.C_RESOLVED && c != Signature.C_UNRESOLVED) {
    throw new IllegalArgumentException();
  }
  int p = start + 1;
  while (true) {
    if (p >= string.length) {
      throw new IllegalArgumentException();
    }
    c = string[p];
    switch (c) {
      case Signature.C_SEMICOLON:
        // all done
        return p;
      case Signature.C_GENERIC_START:
        int e = scanGenericEnd(string, p + 1);
        // once we hit type arguments there are no more package prefixes
        p = e;
        break;
      case Signature.C_DOT:
        buffer.append('.');
        break;
      case '/':
        buffer.append('/');
        break;
      case Signature.C_DOLLAR:
        // once we hit "$" there are no more package prefixes
        /**
         * Convert '$' in resolved type signatures into '.'. NOTE: This assumes that the type
         * signature is an inner type signature. This is true in most cases, but someone can
         * define a non-inner type name containing a '$'.
         */
        buffer.append('.');
        break;
      default:
        buffer.append(c);
    }
    p++;
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:47,代码来源:Util.java

示例3: SourceTypeConverter

private SourceTypeConverter(int flags, ProblemReporter problemReporter) {
  super(problemReporter, Signature.C_DOT);
  this.flags = flags;
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:SourceTypeConverter.java


注:本文中的org.eclipse.jdt.core.Signature.C_DOT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。