This project demonstrates the use of custom annotations and annotation processing in Java. It includes a custom annotation @DTO and an annotation processor DTOProcessor that generates Data Transfer Object (DTO) classes based on the annotated fields.
- simple-annotationprocessor: Contains the custom annotations and the annotation processor.
- simple-annotationprocessor-test: Contains test classes to demonstrate the usage of the annotations and the generated DTOs.
The @DTO annotation is used to specify fields that should be included in a generated DTO class. A separate DTO class is generated for each unique combination of class and value.
The @DTOs annotation is used to make the @DTO annotation repeatable.
The DTOProcessor class processes the @DTO annotations and generates DTO classes.
Here is an example of how to use the @DTO annotation and the generated DTO classes.
To build the project, use the Maven Wrapper:
./mvnw clean installTo run the project using the exec:java plugin, use the following command:
./mvnw install
./mvnw -pl simple-annotationprocessor-test/ exec:java \
-Dexec.mainClass="fr.univtln.bruno.samples.Test"This project is licensed under the MIT License.