简体   繁体   中英

Wrapping AST transformation for Java classes

I have written an AST transformation, which will wrap the method with try-catch block.

The annotation is called ExceptionHandle . This is working in groovy, when I add to any of the methods.

But the same annotation added to the Java class, doesnt work.

It is like Java doesnt support AST transformation that is written in groovy?

Groovy AST only works with a groovy compiler. Since Java and Groovy are compiled differently down to Java bytecode, you can't use AST with .java files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM