当前位置: 首页>>代码示例>>Java>>正文


Java OpensTree类代码示例

本文整理汇总了Java中com.sun.source.tree.OpensTree的典型用法代码示例。如果您正苦于以下问题:Java OpensTree类的具体用法?Java OpensTree怎么用?Java OpensTree使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OpensTree类属于com.sun.source.tree包,在下文中一共展示了OpensTree类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: adjustPathForModuleName

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:GoToSupport.java

示例2: visitOpens

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
@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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:TreeDuplicator.java

示例3: visitOpens

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
@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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:SemanticHighlighterBase.java

示例4: visitOpens

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
@Override
public List<? extends TypeMirror> visitOpens(OpensTree node, Object p) {
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ExpectedTypeResolver.java

示例5: visitOpens

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
@Override
public Mirror visitOpens(OpensTree node, EvaluationContext p) {
    Assert.error(node, "noModules");
    return super.visitOpens(node, p);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:EvaluatorVisitor.java

示例6: visitOpens

import com.sun.source.tree.OpensTree; //导入依赖的package包/类
public void visitOpens(OpensTree node, @SuppressWarnings("unused") TreeVisitor<?, ?> __) {
  mv.visitOpen(qualifiedString(node.getPackageName()), 0, toArray(node.getModuleNames()));
}
 
开发者ID:forax,项目名称:moduletools,代码行数:4,代码来源:JavacModuleParser.java


注:本文中的com.sun.source.tree.OpensTree类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。