I would like to write an annotation processor that generates source code based on the set of JavaBeans properties of processed types.
This works in general, but I am struggling with doing so correctly if other annotation processors are around. Specifically, such other processor may generate a super-class for a type processed by my processor, so I need to take that super-type's properties into account as well. In a subsequent round, a super-class for that super-class may be generated and so on.
This means I must not generate my source code until the hierarchy of the type I am interested is stable, i.e. no further super-types will be generated in subsequent rounds (or in the same round, after my processor has been run) by other processors.
How may I find out if that is the case? I am aware of RoundEnvironment#processingOver()
and the possibility of generating my code in that last final round, but I understand this to be a bad practice (the compiler will issue a warning).