Top Description Methods
org.springframework.beans.factory.aot

public Interface BeanRegistrationAotContribution

Known Direct Implementers
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.AotContribution
Annotations
@FunctionalInterface
Imports
java.util.function.UnaryOperator, org.springframework.aot.generate.GenerationContext, org.springframework.lang.Nullable, org.springframework.util.Assert

AOT contribution from a BeanRegistrationAotProcessor used to register a single bean definition.
Authors
Phillip Webb, Stephane Nicoll
Since
6.0
See Also
BeanRegistrationAotProcessor

Method Summary

Modifier and TypeMethod and Description
public void
applyTo(GenerationContext
the generation context
generationContext
,
BeanRegistrationCode
the generated registration
beanRegistrationCode
)

Apply this contribution to the given BeanRegistrationCode.

public static BeanRegistrationAotContribution

Returns:

the concatenation of the two contributions, or null if they are both null.
concat
(BeanRegistrationAotContribution
the first contribution
a
,
BeanRegistrationAotContribution
the second contribution
b
)

Create a contribution that applies the contribution of the first contribution followed by the second contribution.

public default BeanRegistrationCodeFragments

Returns:

the code fragments to use, may be the original instance or a wrapper
customizeBeanRegistrationCodeFragments
(GenerationContext
the generation context
generationContext
,
BeanRegistrationCodeFragments
the existing code fragments
codeFragments
)

Customize the BeanRegistrationCodeFragments that will be used to generate the bean registration code.

public static BeanRegistrationAotContribution

Returns:

a new BeanRegistrationAotContribution instance
withCustomCodeFragments
(UnaryOperator<BeanRegistrationCodeFragments>
the default code fragments
defaultCodeFragments
)

Create a BeanRegistrationAotContribution that customizes the BeanRegistrationCodeFragments.

Method Detail

applyToback to summary
public void applyTo(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode)

Apply this contribution to the given BeanRegistrationCode.

Parameters
generationContext:GenerationContext

the generation context

beanRegistrationCode:BeanRegistrationCode

the generated registration

concatback to summary
public static BeanRegistrationAotContribution concat(BeanRegistrationAotContribution a, BeanRegistrationAotContribution b)

Create a contribution that applies the contribution of the first contribution followed by the second contribution. Any contribution can be null to be ignored and the concatenated contribution is null if both inputs are null.

Parameters
a:BeanRegistrationAotContribution

the first contribution

b:BeanRegistrationAotContribution

the second contribution

Returns:BeanRegistrationAotContribution

the concatenation of the two contributions, or null if they are both null.

Annotations
@Nullable
Since
6.1
customizeBeanRegistrationCodeFragmentsback to summary
public default BeanRegistrationCodeFragments customizeBeanRegistrationCodeFragments(GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments)

Customize the BeanRegistrationCodeFragments that will be used to generate the bean registration code. Custom code fragments can be used if default code generation isn't suitable.

Parameters
generationContext:GenerationContext

the generation context

codeFragments:BeanRegistrationCodeFragments

the existing code fragments

Returns:BeanRegistrationCodeFragments

the code fragments to use, may be the original instance or a wrapper

withCustomCodeFragmentsback to summary
public static BeanRegistrationAotContribution withCustomCodeFragments(UnaryOperator<BeanRegistrationCodeFragments> defaultCodeFragments)

Create a BeanRegistrationAotContribution that customizes the BeanRegistrationCodeFragments. Typically used in conjunction with an extension of BeanRegistrationCodeFragmentsDecorator that overrides a specific callback.

Parameters
defaultCodeFragments:UnaryOperator<BeanRegistrationCodeFragments>

the default code fragments

Returns:BeanRegistrationAotContribution

a new BeanRegistrationAotContribution instance

See Also
BeanRegistrationCodeFragmentsDecorator