-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Support early class filtering for @ConditionalOnBean, @ConditionalOnSingleCandidate and @ConditionalOnWebApplication #13328
Comments
I'm not sure we can do that. The Perhaps I've misunderstood the suggestion? |
True, is it not possible to evaluate annotation attribute values in annotation processor? |
Possibly. I think I'd rather make |
That would also duplicate the knowledge about the target type. But perhaps there is something else that could be made. Like |
w/r to previous comment, this is the list for SB 2.0.3 (includes all listed starters from start.spring.io)
|
Add `FilteringSpringBootCondition` base class and refactor the existing `OnClassCondition` to use it. Also update the `match` method so that the `autoConfigurationClasses` array may include `null` elements. See gh-13328
Update the auto-configuration annotation processor to generate properties for `@ConditionalOnBean` and `@ConditionalOnSingleCandidate`. See gh-13328
Update `OnBeanCondition` to be an `AutoConfigurationImportFilter` and filter out classes early. See gh-13328
Update the auto-configuration annotation processor to generate properties for `@OnWebApplication`. See gh-13328
Proposal:
For known
Condition
implementations, we "know" that they technically contain a "virtual"@ConditionalOnClass
condition.Sample:
org.springframework.boot.autoconfigure.condition.OnWebApplicationCondition#isServletWebApplication
effectively equals@ConditionalOnClass("org.springframework.web.context.support.GenericWebApplicationContext")
performed by correspondingClassUtils.isPresent()
call.Benefits:
TBD: How can such knowledge be provided/maintained for any custom
Condition
implementation wishing to participate in this metadata generation.The text was updated successfully, but these errors were encountered: