Class RepositoryRegistrationAotContribution
java.lang.Object
org.springframework.data.repository.config.RepositoryRegistrationAotContribution
- All Implemented Interfaces:
BeanRegistrationAotContribution
public class RepositoryRegistrationAotContribution
extends Object
implements BeanRegistrationAotContribution
BeanRegistrationAotContribution used to contribute repository registrations.- Since:
- 3.0
- Author:
- John Blum, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRepositoryRegistrationAotContribution(RepositoryRegistrationAotProcessor processor, AotRepositoryContext context) Constructs a new instance of theRepositoryRegistrationAotContributioninitialized with the given, requiredRepositoryRegistrationAotProcessorfrom which this contribution was created. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(GenerationContext generationContext, BeanRegistrationCode beanRegistrationCode) customizeBeanRegistrationCodeFragments(GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments) @Nullable RepositoryRegistrationAotContributionforBean(RegisteredBean repositoryBean) Deprecated, for removal: This API element is subject to removal in a future version.since 4.0.protected @Nullable BiFunction<AotRepositoryContext, GenerationContext, @Nullable RepositoryContributor> protected AotRepositoryContextprotected RepositoryRegistrationAotProcessorstatic @Nullable RepositoryRegistrationAotContributionload(RepositoryRegistrationAotProcessor processor, RegisteredBean repositoryBean) Factory method used to construct a new instance ofRepositoryRegistrationAotContributioninitialized with the given, requiredRepositoryRegistrationAotProcessorfrom which this contribution was created.withModuleContribution(@Nullable BiFunction<AotRepositoryContext, GenerationContext, @Nullable RepositoryContributor> moduleContribution) Callbackfor data module specific contributions.
-
Constructor Details
-
RepositoryRegistrationAotContribution
protected RepositoryRegistrationAotContribution(RepositoryRegistrationAotProcessor processor, AotRepositoryContext context) Constructs a new instance of theRepositoryRegistrationAotContributioninitialized with the given, requiredRepositoryRegistrationAotProcessorfrom which this contribution was created.- Parameters:
processor- reference back to theRepositoryRegistrationAotProcessorfrom which this contribution was created.context- reference back to theAotRepositoryContextfrom which this contribution was created.- Throws:
IllegalArgumentException- if theRepositoryRegistrationAotProcessoris null.- See Also:
-
-
Method Details
-
load
public static @Nullable RepositoryRegistrationAotContribution load(RepositoryRegistrationAotProcessor processor, RegisteredBean repositoryBean) Factory method used to construct a new instance ofRepositoryRegistrationAotContributioninitialized with the given, requiredRepositoryRegistrationAotProcessorfrom which this contribution was created.- Parameters:
processor- reference back to theRepositoryRegistrationAotProcessorfrom which this contribution was created.- Returns:
- a new instance of
RepositoryRegistrationAotContributionif a contribution can be made; null if no contribution can be made. - See Also:
-
forBean
@Deprecated(since="4.0", forRemoval=true) public @Nullable RepositoryRegistrationAotContribution forBean(RegisteredBean repositoryBean) Deprecated, for removal: This API element is subject to removal in a future version.since 4.0.Builds aRepositoryRegistrationAotContributionfor given, requiredRegisteredBeanrepresenting theRepositoryregistered in the bean registry.- Parameters:
repositoryBean-RegisteredBeanfor theRepository; must not be null.- Returns:
- a
RepositoryRegistrationAotContributionto contribute AOT metadata and code for theRepositoryRegisteredBean. - Throws:
IllegalArgumentException- if theRegisteredBeanis null.
-
getModuleContribution
protected @Nullable BiFunction<AotRepositoryContext, GenerationContext, @Nullable RepositoryContributor> getModuleContribution() -
getRepositoryContext
-
getRepositoryRegistrationAotProcessor
-
getRepositoryInformation
-
withModuleContribution
public RepositoryRegistrationAotContribution withModuleContribution(@Nullable BiFunction<AotRepositoryContext, GenerationContext, @Nullable RepositoryContributor> moduleContribution) Callbackfor data module specific contributions.- Parameters:
moduleContribution-BiConsumerused by data modules to submit contributions; can be null.- Returns:
- this.
-
applyTo
- Specified by:
applyToin interfaceBeanRegistrationAotContribution
-
customizeBeanRegistrationCodeFragments
public BeanRegistrationCodeFragments customizeBeanRegistrationCodeFragments(GenerationContext generationContext, BeanRegistrationCodeFragments codeFragments) - Specified by:
customizeBeanRegistrationCodeFragmentsin interfaceBeanRegistrationAotContribution
-
typeFilter
-