Skip to content

Overhaul annotation support for code generation #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jun 9, 2023 · 0 comments
Closed

Overhaul annotation support for code generation #1424

snicoll opened this issue Jun 9, 2023 · 0 comments
Assignees
Labels
theme: code-generation Issues related to code generation type: enhancement
Milestone

Comments

@snicoll
Copy link
Contributor

snicoll commented Jun 9, 2023

Our support for annotations can be improved with the introduction of CodeBlock. Rather than adding annotations to a type that can no longer be changed, there is a need for being able to customize an existing annotation. Support for the full range of annotation parameters is also welcome.

Looking at the rest of the code base, a container that allows to reuse a Builder for a given annotation type looks ideal. This issue should supersede the following:

Having a centralized annotation handling should make it easy to extend it to more places if we decided to do so.

@snicoll snicoll added type: enhancement theme: code-generation Issues related to code generation labels Jun 9, 2023
@snicoll snicoll added this to the 0.20.0 milestone Jun 9, 2023
@snicoll snicoll self-assigned this Jun 9, 2023
snicoll added a commit to snicoll/initializr that referenced this issue Jun 9, 2023
This commit improves the annotation support so that it handles more
attribute types. An AnnotationContainer is introduced that permits to
further configure an annotation.

This commit adds a number of deprecations:

* Annotation#getName has been deprecated in favor of
Annotation#getClasName.
* Annotable#annotate has been deprecated in favor of
Annotable#annotations()#add.
* Annotable#getAnnotations has been deprecated in favor of
Annotable#annotations()#values.
* Annotation#name has been deprecated in favor of Annotation#of.

This commit also introduces a breaking change by removing the attribute
method on Annotation.Builder as specifying the type of the attribute is
now handled automatically. Use Annotation.Builder#add or
Annotation.Builder#set depending on your needs.

Closes spring-iogh-1424
snicoll added a commit to snicoll/initializr that referenced this issue Jun 10, 2023
This commit improves the annotation support so that it handles more
attribute types. An AnnotationContainer is introduced that permits to
further configure an annotation.

This commit adds a number of deprecations:

* Annotation#getName has been deprecated in favor of
Annotation#getClasName.
* Annotable#annotate has been deprecated in favor of
Annotable#annotations()#add.
* Annotable#getAnnotations has been deprecated in favor of
Annotable#annotations()#values.
* Annotation#name has been deprecated in favor of Annotation#of.

This commit also introduces a breaking change by removing the attribute
method on Annotation.Builder as specifying the type of the attribute is
now handled automatically. Use Annotation.Builder#add or
Annotation.Builder#set depending on your needs.

Closes spring-iogh-1424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: code-generation Issues related to code generation type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant