Interface BeanRegistrationAotContribution
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
AOT contribution from a
BeanRegistrationAotProcessor used to register
a single bean definition.- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) Apply this contribution to the givenBeanRegistrationCode.Create a contribution that applies the contribution of the first contribution followed by the second contribution.default BeanRegistrationCodeFragmentscustomizeBeanRegistrationCodeFragments(GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments) Customize theBeanRegistrationCodeFragmentsthat will be used to generate the bean registration code.withCustomCodeFragments(UnaryOperator<BeanRegistrationCodeFragments> defaultCodeFragments) Create aBeanRegistrationAotContributionthat customizes theBeanRegistrationCodeFragments.
-
Method Details
-
customizeBeanRegistrationCodeFragments
default BeanRegistrationCodeFragments customizeBeanRegistrationCodeFragments(GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments) Customize theBeanRegistrationCodeFragmentsthat will be used to generate the bean registration code. Custom code fragments can be used if default code generation isn't suitable.- Parameters:
generationContext- the generation contextcodeFragments- the existing code fragments- Returns:
- the code fragments to use, may be the original instance or a wrapper
-
applyTo
Apply this contribution to the givenBeanRegistrationCode.- Parameters:
generationContext- the generation contextbeanRegistrationCode- the generated registration
-
withCustomCodeFragments
static BeanRegistrationAotContribution withCustomCodeFragments(UnaryOperator<BeanRegistrationCodeFragments> defaultCodeFragments) Create aBeanRegistrationAotContributionthat customizes theBeanRegistrationCodeFragments. Typically used in conjunction with an extension ofBeanRegistrationCodeFragmentsDecoratorthat overrides a specific callback.- Parameters:
defaultCodeFragments- the default code fragments- Returns:
- a new
BeanRegistrationAotContributioninstance - See Also:
-
concat
static @Nullable BeanRegistrationAotContribution concat(@Nullable BeanRegistrationAotContribution a, @Nullable BeanRegistrationAotContribution b) Create a contribution that applies the contribution of the first contribution followed by the second contribution. Any contribution can benullto be ignored and the concatenated contribution isnullif both inputs arenull.- Parameters:
a- the first contributionb- the second contribution- Returns:
- the concatenation of the two contributions, or
nullif they are bothnull. - Since:
- 6.1
-