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

项目:incubator-netbeans    文件:GoToSupport.java   
private static TreePath adjustPathForModuleName(TreePath path) {
    TreePath tp = path;
    while (tp != null && (tp.getLeaf().getKind() == Kind.IDENTIFIER || tp.getLeaf().getKind() == Kind.MEMBER_SELECT)) {
        Tree parent = tp.getParentPath().getLeaf();
        if (parent.getKind() == Kind.MODULE && ((ModuleTree)parent).getName() == tp.getLeaf()) {
            return tp.getParentPath();
        }
        if (parent.getKind() == Kind.REQUIRES && ((RequiresTree)parent).getModuleName() == tp.getLeaf()
                || parent.getKind() == Kind.EXPORTS && ((ExportsTree)parent).getModuleNames() != null && ((ExportsTree)parent).getModuleNames().contains(tp.getLeaf())
                || parent.getKind() == Kind.OPENS && ((OpensTree)parent).getModuleNames() != null && ((OpensTree)parent).getModuleNames().contains(tp.getLeaf())) {
            return tp;
        }
        tp = tp.getParentPath();
    }
    return path;
}
项目:incubator-netbeans    文件:TreeDuplicator.java   
@Override
public Tree visitRequires(RequiresTree tree, Void p) {
    RequiresTree n = make.Requires(tree.isTransitive(), tree.isStatic(), tree.getModuleName());
    model.setType(n, model.getType(tree));
    comments.copyComments(tree, n);
    model.setPos(n, model.getPos(tree));
    return n;
}
项目:incubator-netbeans    文件:SemanticHighlighterBase.java   
@Override
public Void visitRequires(RequiresTree tree, EnumSet<UseTypes> d) {
    tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(), tree));
    Token t = firstIdentifierToken("requires"); //NOI18N
    if (t != null) {
        contextKeywords.add(t);
        tl.moveNext();
        if (tree.isStatic() && tree.isTransitive()) {
            t = firstIdentifierToken("static", "transitive"); //NOI18N
            if (t != null) {
                contextKeywords.add(t);
            }
            tl.moveNext();
            t = firstIdentifierToken("static", "transitive"); //NOI18N
            if (t != null) {
                contextKeywords.add(t);
            }
        } else if (tree.isStatic()) {
            t = firstIdentifierToken("static"); //NOI18N
            if (t != null) {
                contextKeywords.add(t);
            }
        } else if (tree.isTransitive()) {
            t = firstIdentifierToken("transitive"); //NOI18N
            if (t != null) {
                contextKeywords.add(t);
            }
        }
    }
    return super.visitRequires(tree, d);
}
项目:incubator-netbeans    文件:DefaultProjectModulesModifier.java   
@Override
public Object visitRequires(RequiresTree node, Object p) {
    String s = node.getModuleName().toString();
    URL u = modLocations.get(s);
    if (u != null) {
        resultMap.computeIfAbsent(u, (x) -> new ArrayList<>()).add(g);
    }
    return null;
}
项目:incubator-netbeans    文件:TreeNode.java   
@Override
public Void visitRequires(RequiresTree tree, List<Node> d) {
    List<Node> below = new ArrayList<Node>();

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

    d.add(new TreeNode(info, getCurrentPath(), below));
    return null;
}
项目:incubator-netbeans    文件:ExpectedTypeResolver.java   
@Override
public List<? extends TypeMirror> visitRequires(RequiresTree node, Object p) {
    return null;
}
项目:incubator-netbeans    文件:EvaluatorVisitor.java   
@Override
public Mirror visitRequires(RequiresTree node, EvaluationContext p) {
    Assert.error(node, "noModules");
    return super.visitRequires(node, p);
}
项目:incubator-netbeans    文件:CanInterpretVisitor.java   
@Override
public Boolean visitRequires(RequiresTree node, EvaluationContext p) {
    return Boolean.FALSE;
}
项目:moduletools    文件:JavacModuleParser.java   
public void visitRequires(RequiresTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) {
  int modifiers = (node.isStatic()? ACC_STATIC: 0) | (node.isTransitive()? ACC_TRANSITIVE: 0);
  mv.visitRequire(qualifiedString(node.getModuleName()), modifiers, null);
}
项目:pro    文件:JavacModuleParser.java   
public void visitRequires(RequiresTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) {
  int modifiers = (node.isStatic()? ACC_STATIC: 0) | (node.isTransitive()? ACC_TRANSITIVE: 0);
  mv.visitRequire(qualifiedString(node.getModuleName()), modifiers, null);
}