com.sun.source.tree.TypeParameterTree#getBounds ( )源码实例Demo

下面列出了com.sun.source.tree.TypeParameterTree#getBounds ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

@Override
    public Void visitTypeParameter(TypeParameterTree node, Void unused) {
        sync(node);
        builder.open(ZERO);
        // TODO: 22-Jul-17  missing method java8
//        visitAnnotations(node.getAnnotations(), BreakOrNot.NO, BreakOrNot.YES);
        visit(node.getName());
        if (!node.getBounds().isEmpty()) {
            builder.space();
            token("extends");
            builder.open(plusFour);
            builder.breakOp(" ");
            builder.open(plusFour);
            boolean first = true;
            for (Tree typeBound : node.getBounds()) {
                if (!first) {
                    builder.breakToFill(" ");
                    token("&");
                    builder.space();
                }
                scan(typeBound, null);
                first = false;
            }
            builder.close();
            builder.close();
        }
        builder.close();
        return null;
    }
 
源代码2 项目: netbeans   文件: CreateElementUtilities.java
private static List<? extends TypeMirror> computeTypeParameter(Set<ElementKind> types, CompilationInfo info, TreePath parent, Tree error, int offset) {
    TypeParameterTree tpt = (TypeParameterTree) parent.getLeaf();
    
    for (Tree t : tpt.getBounds()) {
        if (t == error) {
            types.add(ElementKind.CLASS); //XXX: class/interface/enum/annotation?
            return null;
        }
    }
    
    return null;
}
 
源代码3 项目: netbeans   文件: CreateElementUtilities.java
private static List<? extends TypeMirror> computeTypeParameter(Set<ElementKind> types, CompilationInfo info, TreePath parent, Tree error, int offset) {
    TypeParameterTree tpt = (TypeParameterTree) parent.getLeaf();
    
    for (Tree t : tpt.getBounds()) {
        if (t == error) {
            types.add(ElementKind.CLASS); //XXX: class/interface/enum/annotation?
            return null;
        }
    }
    
    return null;
}
 
源代码4 项目: javaide   文件: JavaInputAstVisitor.java
@Override
    public Void visitTypeParameter(TypeParameterTree node, Void unused) {
        sync(node);
        builder.open(ZERO);
        // TODO: 22-Jul-17  missing method java8
//        visitAnnotations(node.getAnnotations(), BreakOrNot.NO, BreakOrNot.YES);
        visit(node.getName());
        if (!node.getBounds().isEmpty()) {
            builder.space();
            token("extends");
            builder.open(plusFour);
            builder.breakOp(" ");
            builder.open(plusFour);
            boolean first = true;
            for (Tree typeBound : node.getBounds()) {
                if (!first) {
                    builder.breakToFill(" ");
                    token("&");
                    builder.space();
                }
                scan(typeBound, null);
                first = false;
            }
            builder.close();
            builder.close();
        }
        builder.close();
        return null;
    }
 
源代码5 项目: google-java-format   文件: JavaInputAstVisitor.java
@Override
public Void visitTypeParameter(TypeParameterTree node, Void unused) {
  sync(node);
  builder.open(ZERO);
  visitAnnotations(node.getAnnotations(), BreakOrNot.NO, BreakOrNot.YES);
  visit(node.getName());
  if (!node.getBounds().isEmpty()) {
    builder.space();
    token("extends");
    builder.open(plusFour);
    builder.breakOp(" ");
    builder.open(plusFour);
    boolean first = true;
    for (Tree typeBound : node.getBounds()) {
      if (!first) {
        builder.breakToFill(" ");
        token("&");
        builder.space();
      }
      scan(typeBound, null);
      first = false;
    }
    builder.close();
    builder.close();
  }
  builder.close();
  return null;
}
 
 同类方法