I have several checks that are performed using java annotation processors but I would also like to do checks for types that are not annotated.
For example, if we suppose I have an annotation like @Responsible(name="xyz")
what is the best approach to hook into the compilation process to enforce that the annotation is present for all top level types.
With my current implementation I rely on two annotations, the expected one (Responsible) and a package level one. The later is used to 'fire' the annotation processor even if no expected annotation is present. Inside the fired annotation processor I then search & filter java files on disk (using passed arguments to compiler) to gather all the files that I'd like to be processed and filter them when the java file correspond to an annotated type the processor is handling. Doing so if someone commits a new file without specifying the annotation the build fail.
Isn't there a cleaner way to find the 'non annotated' types?