org.eclipse.jdt.core.dom.Annotation.toString()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(124)

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

Annotation.toString介绍

暂无

代码示例

代码示例来源:origin: forge/roaster

@Override
public String toString()
{
 return annotation.toString();
}

代码示例来源:origin: org.jboss.forge/roaster-jdt

@Override
public String toString()
{
 return annotation.toString();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup,
    boolean astLevelGTE8) {
  if (astLevelGTE8) {
    Dimension dim = (Dimension) replacingType.dimensions().get(index);
    List annotations = dim.annotations();
    if (annotations != null) {
      int size = annotations.size();
      if (size > 0) {
        doTextInsert(pos, " ", editGroup); //$NON-NLS-1$
        for (int j = 0; j < size; j++) {
          Annotation annotation = (Annotation) annotations.get(j);
          doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e

/**
 * Gets the sibling where the given {@link Annotation} should be added to the given {@link BodyDeclaration}. The
 * {@link Annotation} must be added before the returned node.
 *
 * @param owner
 *          The owner of the {@link Annotation}.
 * @param newAnnotation
 *          The new {@link Annotation} that should be added.
 * @return The
 */
public static ASTNode getAnnotationSibling(BodyDeclaration owner, Annotation newAnnotation) {
 Deque<Annotation> annotations = getAnnotations(owner);
 if (!annotations.isEmpty()) {
  int newAnnotLen = newAnnotation.toString().length();
  Iterator<Annotation> iterator = annotations.descendingIterator();
  while (iterator.hasNext()) {
   Annotation existingAnnotation = iterator.next();
   int len = existingAnnotation.getLength();
   if (len > 0 && len >= newAnnotLen) {
    return existingAnnotation;
   }
  }
 }
 for (Object o : owner.modifiers()) {
  if (o instanceof Modifier) {
   return (Modifier) o;
  }
 }
 return null;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup,
    boolean astLevelGTE8) {
  if (astLevelGTE8) {
    Dimension dim = (Dimension) replacingType.dimensions().get(index);
    List annotations = dim.annotations();
    if (annotations != null) {
      int size = annotations.size();
      if (size > 0) {
        doTextInsert(pos, " ", editGroup); //$NON-NLS-1$
        for (int j = 0; j < size; j++) {
          Annotation annotation = (Annotation) annotations.get(j);
          doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$
        }
      }
    }
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup,
    boolean astLevelGTE8) {
  if (astLevelGTE8) {
    Dimension dim = (Dimension) replacingType.dimensions().get(index);
    List annotations = dim.annotations();
    if (annotations != null) {
      int size = annotations.size();
      if (size > 0) {
        doTextInsert(pos, " ", editGroup); //$NON-NLS-1$
        for (int j = 0; j < size; j++) {
          Annotation annotation = (Annotation) annotations.get(j);
          doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$
        }
      }
    }
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup,
    boolean astLevelGTE8) {
  if (astLevelGTE8) {
    Dimension dim = (Dimension) replacingType.dimensions().get(index);
    List annotations = dim.annotations();
    if (annotations != null) {
      int size = annotations.size();
      if (size > 0) {
        doTextInsert(pos, " ", editGroup); //$NON-NLS-1$
        for (int j = 0; j < size; j++) {
          Annotation annotation = (Annotation) annotations.get(j);
          doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$
        }
      }
    }
  }
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

private void insertAnnotationsOnDimension(ArrayType replacingType, int index, int pos, TextEditGroup editGroup,
    boolean astLevelGTE8) {
  if (astLevelGTE8) {
    Dimension dim = (Dimension) replacingType.dimensions().get(index);
    List annotations = dim.annotations();
    if (annotations != null) {
      int size = annotations.size();
      if (size > 0) {
        doTextInsert(pos, " ", editGroup); //$NON-NLS-1$
        for (int j = 0; j < size; j++) {
          Annotation annotation = (Annotation) annotations.get(j);
          doTextInsert(pos, annotation.toString() + " ", editGroup); //$NON-NLS-1$
        }
      }
    }
  }
}

代码示例来源:origin: windup/windup

compilationUnit.getColumnNumber(node.getStartPosition()),
node.getLength(),
node.toString());

相关文章