Package nl.datasteel.crudcraft.codegen
Class CrudCraftProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
nl.datasteel.crudcraft.codegen.CrudCraftProcessor
- All Implemented Interfaces:
Processor
@AutoService(javax.annotation.processing.Processor.class)
@SupportedAnnotationTypes({"nl.datasteel.crudcraft.annotations.classes.CrudCrafted","nl.datasteel.crudcraft.annotations.classes.CrudCraftExtension","nl.datasteel.crudcraft.annotations.fields.Dto","nl.datasteel.crudcraft.annotations.fields.Request","nl.datasteel.crudcraft.annotations.fields.Response","nl.datasteel.crudcraft.annotations.fields.Searchable","jakarta.persistence.Embeddable"})
@SupportedSourceVersion(RELEASE_21)
public class CrudCraftProcessor
extends AbstractProcessor
Annotation processor for CrudCraft.
This processor scans for classes annotated with CrudCrafted and Embeddable,
and generates the necessary code based on the annotations present.
It supports various annotations related to CRUD operations,
including Dto, Request, Response, Searchable, and others.
-
Field Summary
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Initializes the processor with the processing environment.boolean
process
(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) Processes the annotations found in the current round.Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, getSupportedSourceVersion, isInitialized
-
Constructor Details
-
CrudCraftProcessor
public CrudCraftProcessor()
-
-
Method Details
-
init
Initializes the processor with the processing environment. This method is called by the annotation processing framework before any processing occurs.- Specified by:
init
in interfaceProcessor
- Overrides:
init
in classAbstractProcessor
- Parameters:
env
- The processing environment provided by the framework.
-
process
Processes the annotations found in the current round. It collects all model descriptors from classes annotated with CrudCrafted and Embeddable, and writes the generated code using the WriterRegistry.- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
- Parameters:
annotations
- The set of annotations to process.roundEnv
- The current round environment.- Returns:
- true if the annotations were processed successfully, false otherwise.
-