- Correct.
- Correct.
- Correct. Typically you will extend
AbstractProcessor
. You specify yourMyAnnotationProcessor
class using theServiceLoader
pattern - this makes it discoverable to the compiler. TheProcessor
Javadoc contains some information on creating this class. - Correct.
- This part is not correct. The annotation processor framework does not give you the ability to modify classes. You will need to use some post-compile process to do this as part of your build. What it does allow you to do is create new files. These may be simple resources, new Java source files (that will subsequently be required and eligible to the annotation processor during the same compile), or Java class files. You may also perform custom checks on source code and write errors to the log (causing the compile to fail).
I hope that addresses your understanding questions.