This should be possible, as the following project does this: Project Lombok
also:
Java 8 introduced a new mechanism for writing plugins for the Java compiler (javac). The compiler plugin allows you to add new phases to javac without making changes to its code base. New behavior can be encapsulated in the plugin and distributed to other people. For example, javac plugins can be used to do the following:
• Add additional compile time checks
• Add code conversions
• Perform individual source code analysis
source share