1

数日前に公式のJavaサポートフォーラムに投稿したように、JCTreeシンボルが元のjavac実装を使用して独自のコードから解決できるかどうかを知りたいと思います。

http://forums.oracle.com/forums/thread.jspa?threadID=1774807&tstart=0

JCMethodInvocation object1 = (JCMethodInvocation) objectRef.ref;

Resolve resolve = Resolve.instance(javacTaskImpl.getContext());

ListBuffer<Type> argtypeListBuffer = new ListBuffer<Type>();
AttrContext attrContext = new AttrContext();
Env<AttrContext> env = new Env<AttrContext>((JCTree) objectRef.ref, attrContext);

System.out.println(type);
System.out.println(type.tsym);

resolve.resolveInternalMethod(object1.pos(), env, type, name, argtypeListBuffer.toList(), null);`
4

1 に答える 1

0

com.sun.tools.javac.main.JavaCompiler がシンボルを解決する方法を調査することをお勧めします。#enterTrees(List) の中にあると思います

また、プロジェクトhttp://bitbucket.org/amelentev/juast/および projectlombok.orgに興味があるかもしれません

于 2010-10-30T22:22:50.713 に答える