Java 类com.sun.source.tree.IntersectionTypeTree 实例源码

项目:annotation-tools    文件:IntersectionTypeLocationCriterion.java   
@Override
public boolean isSatisfiedBy(TreePath path) {
  TreePath parentPath = path.getParentPath();
  if (parentPath != null) {
    Tree parent = parentPath.getLeaf();
    if (parent.getKind() == Tree.Kind.INTERSECTION_TYPE) {
      IntersectionTypeTree itt = (IntersectionTypeTree) parent;
      List<? extends Tree> bounds = itt.getBounds();
      Tree leaf = path.getLeaf();
      if (typeIndex < bounds.size()
          && leaf == bounds.get(typeIndex)) {
        return true;
      }
    }
  }
  Tree.Kind kind = path.getLeaf().getKind();
  if (ASTPath.isTypeKind(kind) || kind == Tree.Kind.MEMBER_SELECT) {
    return isSatisfiedBy(path.getParentPath());
  }
  return false;
}
项目:incubator-netbeans    文件:TreeDuplicator.java   
@Override
public Tree visitIntersectionType(IntersectionTypeTree tree, Void p) {
    IntersectionTypeTree n = make.IntersectionType(tree.getBounds());
    model.setType(n, model.getType(tree));
    comments.copyComments(tree, n);
    model.setPos(n, model.getPos(tree));
    return n;
}
项目:incubator-netbeans    文件:DependencyCollector.java   
@Override
public Object visitIntersectionType(IntersectionTypeTree node, Object p) {
    for (Tree t : node.getBounds()) {
        addDependency(info.getTrees().getTypeMirror(new TreePath(getCurrentPath(), t)));
    }
    return super.visitIntersectionType(node, p);
}
项目:incubator-netbeans    文件:TreeNode.java   
@Override
public Void visitIntersectionType(IntersectionTypeTree tree, List<Node> d) {
    List<Node> below = new ArrayList<Node>();

    addCorrespondingType(below);
    addCorrespondingComments(below);
    super.visitIntersectionType(tree, below);

    d.add(new TreeNode(info, getCurrentPath(), below));
    return null;
}
项目:incubator-netbeans    文件:EvaluatorVisitor.java   
@Override
public Mirror visitIntersectionType(IntersectionTypeTree node, EvaluationContext p) {
    // intersection type in a cast expression
    List<? extends Tree> bounds = node.getBounds();
    List<ReferenceType> typeList = new ArrayList<ReferenceType>();
    for (Tree type : bounds) {
        Mirror typeMirror = type.accept(this, p);
        if (typeMirror instanceof ReferenceType) {
            typeList.add((ReferenceType) typeMirror);
        }
    }
    Type intersectionType = new IntersectionType(typeList.toArray(new ReferenceType[] {}));
    subExpressionTypes.put(node, intersectionType);
    return intersectionType;
}
项目:error-prone    文件:ErrorProneScanner.java   
@Override
public Void visitIntersectionType(IntersectionTypeTree tree, VisitorState visitorState) {
  VisitorState state = visitorState.withPath(getCurrentPath());
  for (IntersectionTypeTreeMatcher matcher : intersectionTypeMatchers) {
    if (!isSuppressed(matcher, state)) {
      try {
        reportMatch(matcher.matchIntersectionType(tree, state), tree, state);
      } catch (Throwable t) {
        handleError(matcher, t);
      }
    }
  }
  return super.visitIntersectionType(tree, state);
}
项目:incubator-netbeans    文件:ExpectedTypeResolver.java   
@Override
public List<? extends TypeMirror> visitIntersectionType(IntersectionTypeTree node, Object p) {
    return null;
}
项目:oblivion-netbeans-plugin    文件:ApexTreeVisitorAdapter.java   
@Override
public R visitIntersectionType(IntersectionTypeTree itt, P p) {
    return null;
}
项目:oblivion-netbeans-plugin    文件:TreeFinder.java   
@Override
public List<T> visitIntersectionType(IntersectionTypeTree node, T p) {
    return checkForCriteria(node);
}
项目:error-prone    文件:UTemplater.java   
@Override
public UIntersectionType visitIntersectionType(IntersectionTypeTree tree, Void v) {
  return UIntersectionType.create(templateTypeExpressions(tree.getBounds()));
}
项目:error-prone    文件:UIntersectionType.java   
@Override
public Choice<Unifier> visitIntersectionType(IntersectionTypeTree node, Unifier unifier) {
  return unifyList(unifier, getBounds(), node.getBounds());
}
项目:checker-framework    文件:PurityChecker.java   
@Override
public PurityResult visitIntersectionType(IntersectionTypeTree node, PurityResult p) {
    assert false : "this type of tree is unexpected here";
    return null;
}
项目:error-prone    文件:BugChecker.java   
Description matchIntersectionType(IntersectionTypeTree tree, VisitorState state);