#What does this mean? I am reading about annotation processing API

1 messages · Page 1 of 1 (latest)

prisma trench
#

https://www.baeldung.com/java-annotation-processing-builder#Annotation

"Annotation Processing API
The annotation processing is done in multiple rounds. Each round starts with the compiler searching for the annotations in the source files and choosing the annotation processors suited for these annotations. Each annotation processor, in turn, is called on the corresponding sources.

If any files are generated during this process, another round is started with the generated files as its input. This process continues until no new files are generated during the processing stage.

Each annotation processor, in turn, is called on the corresponding sources. If any files are generated during this process, another round is started with the generated files as its input. This process continues until no new files are generated during the processing stage.

The annotation processing API is located in the javax.annotation.processing package. The main interface that you’ll have to implement is the Processor interface, which has a partial implementation in the form of AbstractProcessor class. This class is the one we’re going to extend to create our own annotation processor."

So, this is the concept right?

@RandomAnnoation
public class RagJN{
      //do some stuff

} 

This annoation generates some other annoation during compilation.
Generated source

@RandomGeneratedAnnotation
public class RagJNGeneratedSource{


}

now it keep continuing till no annoation is found

did I get it correct?

Baeldung

A quick and practical guide to annotation processing in Java, showing you how to create a builder from a POJO.

inland oakBOT
#

<@&987246399047479336> please have a look, thanks.

spare ridge
#

now it keep continuing till no annoation is found
until no new files are generated

#

in simple terms: each file (including any file that gets generated during the process) will get handed to the annotation processor for processing

prisma trench
spare ridge
#

processing an annotation might lead to generating new files

#

and those new files might have annotations as well

#

so they need to get processed as well

#

which could lead to more files generated and so on

#

so this process continues until everything was processed and no more new files spawned

prisma trench