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

项目: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 visitOpens(OpensTree tree, Void p) {
    OpensTree n = make.Opens(tree.getPackageName(), tree.getModuleNames());
    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 visitOpens(OpensTree tree, EnumSet<UseTypes> d) {
    tl.moveToOffset(sourcePositions.getStartPosition(info.getCompilationUnit(), tree));
    Token t = firstIdentifierToken("opens"); //NOI18N
    if (t != null) {
        contextKeywords.add(t);
    }
    scan(tree.getPackageName(), d);
    tl.moveToOffset(sourcePositions.getEndPosition(info.getCompilationUnit(), tree.getPackageName()));
    t = firstIdentifierToken("to"); //NOI18N
    if (t != null) {
        contextKeywords.add(t);
    }
    return scan(tree.getModuleNames(), d);
}
项目:incubator-netbeans    文件:ExpectedTypeResolver.java   
@Override
public List<? extends TypeMirror> visitOpens(OpensTree node, Object p) {
    return null;
}
项目:incubator-netbeans    文件:EvaluatorVisitor.java   
@Override
public Mirror visitOpens(OpensTree node, EvaluationContext p) {
    Assert.error(node, "noModules");
    return super.visitOpens(node, p);
}
项目:moduletools    文件:JavacModuleParser.java   
public void visitOpens(OpensTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) {
  mv.visitOpen(qualifiedString(node.getPackageName()), 0, toArray(node.getModuleNames()));
}
项目:pro    文件:JavacModuleParser.java   
public void visitOpens(OpensTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) {
  mv.visitOpen(qualifiedString(node.getPackageName()), 0, toArray(node.getModuleNames()));
}