Skip to content
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

Introduce MergedAnnotation finder methods #22569

Closed
philwebb opened this issue Mar 11, 2019 · 4 comments
Closed

Introduce MergedAnnotation finder methods #22569

philwebb opened this issue Mar 11, 2019 · 4 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@philwebb
Copy link
Member

philwebb commented Mar 11, 2019

Code to locate methods on classes based on annotations currently mostly uses a combination of MethodIntrospector and AnnotatedElementUtils.

For example, in EventListenerMethodProcessor:

annotatedMethods = MethodIntrospector.selectMethods(targetType,
(MethodIntrospector.MetadataLookup<EventListener>) method ->
AnnotatedElementUtils.findMergedAnnotation(method, EventListener.class));

With the addition of the new MergedAnnotations API along with the annotation index work it might be nicer if we had a first class way to find such methods.

One possible solution would be to add finder methods to MergedAnnotation.

For example:

MergedAnnotation.find(SomeAnnotation.class).onMethodsIn(SomeCandidate.class);
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 11, 2019
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Mar 12, 2019
@andresetevejob

This comment has been minimized.

@snicoll

This comment has been minimized.

@andresetevejob

This comment has been minimized.

@sbrannen sbrannen added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement and removed for: team-attention status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 27, 2022
@sbrannen
Copy link
Member

Team Decision: features like MethodIntrospector and MergedAnnotations are orthogonal concerns and should therefore not be combined in a common API/implementation.

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants