Module spring.data.commons
Class RepositoryConfigurationSourceSupport
java.lang.Object
org.springframework.data.repository.config.RepositoryConfigurationSourceSupport
- All Implemented Interfaces:
RepositoryConfigurationSource
- Direct Known Subclasses:
AnnotationRepositoryConfigurationSource,XmlRepositoryConfigurationSource
public abstract class RepositoryConfigurationSourceSupport
extends Object
implements RepositoryConfigurationSource
Base class to implement
RepositoryConfigurationSources.- Author:
- Oliver Gierke, Thomas Darimont, Peter Rietzler, Jens Schauder
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRepositoryConfigurationSourceSupport(Environment environment, ClassLoader classLoader, BeanDefinitionRegistry registry, BeanNameGenerator generator) Creates a newRepositoryConfigurationSourceSupportwith the given environment. -
Method Summary
Modifier and TypeMethodDescriptiongenerateBeanName(BeanDefinition beanDefinition) Returns a name for the beanDefinition.getCandidates(ResourceLoader loader) Returns the sourceBeanDefinitions of the repository interfaces to create repository instances for.Return theTypeFilters to define which types to exclude when scanning for repositories.protected Iterable<TypeFilter>Return theTypeFilters to define which types to include when scanning for repositories.booleanReturns whether we should consider nested repositories, i.e. repository interface definitions nested in other classes.Returns theImplementationDetectionConfigurationto be used to scan for custom implementations of the repository instances to be created from thisRepositoryConfigurationSource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.repository.config.RepositoryConfigurationSource
getAttribute, getAttribute, getBasePackages, getBootstrapMode, getNamedQueryLocation, getQueryLookupStrategyKey, getRepositoryBaseClassName, getRepositoryFactoryBeanClassName, getRepositoryImplementationPostfix, getRequiredAttribute, getResourceDescription, getSource, usesExplicitFilters
-
Field Details
-
DEFAULT_REPOSITORY_IMPL_POSTFIX
- See Also:
-
-
Constructor Details
-
RepositoryConfigurationSourceSupport
public RepositoryConfigurationSourceSupport(Environment environment, ClassLoader classLoader, BeanDefinitionRegistry registry, BeanNameGenerator generator) Creates a newRepositoryConfigurationSourceSupportwith the given environment.- Parameters:
environment- must not be null.classLoader- must not be null.registry- must not be null.
-
-
Method Details
-
getCandidates
Description copied from interface:RepositoryConfigurationSourceReturns the sourceBeanDefinitions of the repository interfaces to create repository instances for.- Specified by:
getCandidatesin interfaceRepositoryConfigurationSource- Returns:
-
getExcludeFilters
Return theTypeFilters to define which types to exclude when scanning for repositories. Default implementation returns an empty collection.- Specified by:
getExcludeFiltersin interfaceRepositoryConfigurationSource- Returns:
- must not be null.
-
generateBeanName
Description copied from interface:RepositoryConfigurationSourceReturns a name for the beanDefinition.- Specified by:
generateBeanNamein interfaceRepositoryConfigurationSource- Parameters:
beanDefinition- must not be null.- Returns:
-
getIncludeFilters
Return theTypeFilters to define which types to include when scanning for repositories. Default implementation returns an empty collection.- Returns:
- must not be null.
-
shouldConsiderNestedRepositories
public boolean shouldConsiderNestedRepositories()Returns whether we should consider nested repositories, i.e. repository interface definitions nested in other classes.- Returns:
- true if the container should look for nested repository interface definitions.
-
toImplementationDetectionConfiguration
public ImplementationDetectionConfiguration toImplementationDetectionConfiguration(MetadataReaderFactory factory) Description copied from interface:RepositoryConfigurationSourceReturns theImplementationDetectionConfigurationto be used to scan for custom implementations of the repository instances to be created from thisRepositoryConfigurationSource.- Specified by:
toImplementationDetectionConfigurationin interfaceRepositoryConfigurationSource- Returns:
- will never be null.
-