Yes, this should be possible. You would want to look at creating your own Forge addon,
that relies on the parser-java
(
https://github.com/forge/core/blob/master/parser-java/README.asciidoc) addon, and the
related Roaster project (
https://github.com/forge/roaster) (for parsing and manipulating
Java source files).
Posted by forums
Original post:
https://community.jboss.org/message/870556#870556