本文整理汇总了Java中com.sun.tools.javac.tree.TreeInfo.fullName方法的典型用法代码示例。如果您正苦于以下问题:Java TreeInfo.fullName方法的具体用法?Java TreeInfo.fullName怎么用?Java TreeInfo.fullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.tree.TreeInfo
的用法示例。
在下文中一共展示了TreeInfo.fullName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitExports
import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
@Override
public void visitExports(JCExports tree) {
Name name = TreeInfo.fullName(tree.qualid);
PackageSymbol packge = syms.enterPackage(sym, name);
attr.setPackageSymbols(tree.qualid, packge);
if (!allExports.add(packge)) {
log.error(tree.qualid.pos(), Errors.DuplicateExports(packge));
}
List<ModuleSymbol> toModules = null;
if (tree.moduleNames != null) {
Set<ModuleSymbol> to = new HashSet<>();
for (JCExpression n: tree.moduleNames) {
ModuleSymbol msym = lookupModule(n);
if (msym.kind != MDL) {
log.error(n.pos(), Errors.ModuleNotFound(msym));
} else if (!to.add(msym)) {
log.error(n.pos(), Errors.DuplicateExports(msym));
}
}
toModules = List.from(to);
}
if (toModules == null || !toModules.isEmpty()) {
ExportsDirective d = new ExportsDirective(packge, toModules);
tree.directive = d;
sym.exports = sym.exports.prepend(d);
}
}
示例2: lookupModule
import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
private ModuleSymbol lookupModule(JCExpression moduleName) {
try {
Name name = TreeInfo.fullName(moduleName);
ModuleSymbol msym = moduleFinder.findModule(name);
TreeInfo.setSymbol(moduleName, msym);
return msym;
} catch (Throwable t) {
System.err.println("Module " + sym + "; lookup export " + moduleName);
throw t;
}
}
示例3: visitApply
import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
@Override
public void visitApply(JCMethodInvocation invocation) {
final JCExpression method = invocation.getMethodSelect();
final Name fullName = TreeInfo.fullName(method);
final IsNamedType name = service.getName(cup, invocation);
for (MethodMatcher<MagicMethodInjector> matcher : matchers) {
final Optional<MagicMethodInjector> result = matcher.matches(name);
if (result.isPresent()) {
matched.add(Out2.out2Immutable(invocation, result.get()));
}
}
super.visitApply(invocation);
}
示例4: lookupModule
import com.sun.tools.javac.tree.TreeInfo; //导入方法依赖的package包/类
private ModuleSymbol lookupModule(JCExpression moduleName) {
Name name = TreeInfo.fullName(moduleName);
ModuleSymbol msym = moduleFinder.findModule(name);
TreeInfo.setSymbol(moduleName, msym);
return msym;
}