openrewrite / rewrite-templating

Automated templating using code snippets.
Apache License 2.0
16 stars 7 forks source link

Allow other annotation processors to process too #40

Closed timtebeek closed 11 months ago

timtebeek commented 11 months ago

What's changed?

Return true from boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv).

What's your motivation?

Needed to play well with Picnic/error-prone-support, as their own processor wants to create .refaster files from the same Refaster templates.

Any additional context

Processes a set of annotation types on type elements originating from the prior round and returns whether or not these annotation types are claimed by this processor. If true is returned, the annotation types are claimed and subsequent processors will not be asked to process them; if false is returned, the annotation types are unclaimed and subsequent processors may be asked to process them. A processor may always return the same boolean value or may vary the result based on chosen criteria. The input set will be empty if the processor supports "*" and the root elements have no annotations. A Processor must gracefully handle an empty set of annotations. public abstract boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv);