This commit introduces the ConditionalOnAnnotation, a custom conditional annotation that enables bean registration based on the presence of a specified annotation with RUNTIME retention. It ensures beans are only loaded when the annotated class or method is marked with a user-defined annotation, facilitating feature toggling and modular configuration.
Comment From: pivotal-cla
@Zodiacxxy Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@Zodiacxxy Thank you for signing the Contributor License Agreement!
Comment From: Zodiacxxy
Add new ConditionalOnAnnotation for conditional bean loading
This commit introduces the ConditionalOnAnnotation, a custom conditional annotation that enables bean registration based on the presence of a specified annotation with RUNTIME retention. It ensures beans are only loaded when the annotated class or method is marked with a user-defined annotation, facilitating feature toggling and modular configuration.
Comment From: wilkinsona
Thanks for the suggestion. Looking at the implementation, is this not the same as the functionality that's already provided by the annotation attribute of @ConditionalOnBean?
Comment From: Zodiacxxy
Thanks for the suggestion. Looking at the implementation, is this not the same as the functionality that's already provided by the
annotationattribute of@ConditionalOnBean?
yes, you are right. That @ConditionalOnBean is same with that and it works for me. Thanks for so quickly replay.