本文整理汇总了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;
}
示例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;
}
示例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);
}
示例4: visitOpens
import com.sun.source.tree.OpensTree; //导入依赖的package包/类
@Override
public List<? extends TypeMirror> visitOpens(OpensTree node, Object p) {
return null;
}
示例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);
}
示例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()));
}