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
RepositoryConfigurationSource
s.- Author:
- Oliver Gierke, Thomas Darimont, Peter Rietzler, Jens Schauder
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRepositoryConfigurationSourceSupport
(Environment environment, ClassLoader classLoader, BeanDefinitionRegistry registry, BeanNameGenerator generator) Creates a newRepositoryConfigurationSourceSupport
with the given environment. -
Method Summary
Modifier and TypeMethodDescriptiongenerateBeanName
(BeanDefinition beanDefinition) Returns a name for the beanDefinition.getCandidates
(ResourceLoader loader) Returns the sourceBeanDefinition
s of the repository interfaces to create repository instances for.Return theTypeFilter
s to define which types to exclude when scanning for repositories.protected Iterable<TypeFilter>
Return theTypeFilter
s to define which types to include when scanning for repositories.boolean
Returns whether we should consider nested repositories, i.e. repository interface definitions nested in other classes.Returns theImplementationDetectionConfiguration
to 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, wait
Methods 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 newRepositoryConfigurationSourceSupport
with 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:RepositoryConfigurationSource
Returns the sourceBeanDefinition
s of the repository interfaces to create repository instances for.- Specified by:
getCandidates
in interfaceRepositoryConfigurationSource
- Returns:
-
getExcludeFilters
Return theTypeFilter
s to define which types to exclude when scanning for repositories. Default implementation returns an empty collection.- Specified by:
getExcludeFilters
in interfaceRepositoryConfigurationSource
- Returns:
- must not be null.
-
generateBeanName
Description copied from interface:RepositoryConfigurationSource
Returns a name for the beanDefinition.- Specified by:
generateBeanName
in interfaceRepositoryConfigurationSource
- Parameters:
beanDefinition
- must not be null.- Returns:
-
getIncludeFilters
Return theTypeFilter
s 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:RepositoryConfigurationSource
Returns theImplementationDetectionConfiguration
to be used to scan for custom implementations of the repository instances to be created from thisRepositoryConfigurationSource
.- Specified by:
toImplementationDetectionConfiguration
in interfaceRepositoryConfigurationSource
- Returns:
- will never be null.
-