Is it possible to get JcTree of a class in another jar?

32 views
Skip to first unread message

jack lee

unread,
Jan 19, 2022, 3:39:31 AMJan 19
to Project Lombok
Hi all.

Asume we are prosessing class A,  there is a class B have some info needed.

If B is in the same module of A, i find a way to get B's  JcTree:

```
TreePath path = javacTrees.getPath(bElement);
JCTree.JCCompilationUnit jcCu = (JCTree.JCCompilationUnit) path.getCompilationUnit();
JavacAST ast = new JavacAST(messager, context, jcCu, cleanup);
```

But if B is not in the same module of A,  it's in another module(or jar), then it's a compiled  class file.

Is there any way to get jctree of B, while AbstractProcessor or JavacAnnotationHandler is processing A?
Reply all
Reply to author
Forward
0 new messages