Class XmlRepositoryConfigurationSource
java.lang.Object
org.springframework.data.repository.config.RepositoryConfigurationSourceSupport
org.springframework.data.repository.config.XmlRepositoryConfigurationSource
- All Implemented Interfaces:
RepositoryConfigurationSource
XML based
RepositoryConfigurationSource. Uses configuration defined on Element attributes.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Peter Rietzler, Jens Schauder
-
Field Summary
Fields inherited from class org.springframework.data.repository.config.RepositoryConfigurationSourceSupport
DEFAULT_REPOSITORY_IMPL_POSTFIX -
Constructor Summary
ConstructorsConstructorDescriptionXmlRepositoryConfigurationSource(Element element, org.springframework.beans.factory.xml.ParserContext context, org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Returns the value for theStringattribute with the given name.<T> Optional<T>getAttribute(String name, Class<T> type) Returns the value for the attribute with the given name and type.Returns the base packages the repository interfaces shall be found under.Defines the repositoryBootstrapModeto be used.Returns the XML element backing the configuration.Streamable<org.springframework.core.type.filter.TypeFilter>Return theTypeFilters to define which types to exclude when scanning for repositories.protected Iterable<org.springframework.core.type.filter.TypeFilter>Return theTypeFilters to define which types to include when scanning for repositories.Returns theQueryLookupStrategy.Keyto define how query methods shall be resolved.Returns the name of the repository base class to be used orOptional.empty()if the store specific defaults shall be applied.Returns the name of the repository factory bean class orOptional.empty()if not defined in the source.Returns the configured postfix to be used for looking up custom implementation classes.Returns a human readable description of the repository configuration source for error reporting purposes.Returns the actual source object that the configuration originated from.booleanReturns whether we should consider nested repositories, i.e. repository interface definitions nested in other classes.booleanReturns whether the configuration uses explicit filtering to scan for repository types.Methods inherited from class org.springframework.data.repository.config.RepositoryConfigurationSourceSupport
generateBeanName, getCandidates, toImplementationDetectionConfigurationMethods 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
getRequiredAttribute
-
Constructor Details
-
XmlRepositoryConfigurationSource
public XmlRepositoryConfigurationSource(Element element, org.springframework.beans.factory.xml.ParserContext context, org.springframework.core.env.Environment environment) - Parameters:
element- must not be null.context- must not be null.environment- must not be null.
-
-
Method Details
-
getSource
Description copied from interface:RepositoryConfigurationSourceReturns the actual source object that the configuration originated from. Will be used by the tooling to give visual feedback on where the repository instances actually come from. @return. -
getBasePackages
Description copied from interface:RepositoryConfigurationSourceReturns the base packages the repository interfaces shall be found under.- Returns:
- must not be null.
-
getQueryLookupStrategyKey
Description copied from interface:RepositoryConfigurationSourceReturns theQueryLookupStrategy.Keyto define how query methods shall be resolved.- Returns:
-
getNamedQueryLocation
- Returns:
-
getElement
Returns the XML element backing the configuration.- Returns:
- the element
-
getExcludeFilters
Description copied from class:RepositoryConfigurationSourceSupportReturn theTypeFilters to define which types to exclude when scanning for repositories. Default implementation returns an empty collection.- Specified by:
getExcludeFiltersin interfaceRepositoryConfigurationSource- Overrides:
getExcludeFiltersin classRepositoryConfigurationSourceSupport- Returns:
- must not be null.
-
getIncludeFilters
Description copied from class:RepositoryConfigurationSourceSupportReturn theTypeFilters to define which types to include when scanning for repositories. Default implementation returns an empty collection.- Overrides:
getIncludeFiltersin classRepositoryConfigurationSourceSupport- Returns:
- must not be null.
-
getRepositoryImplementationPostfix
Description copied from interface:RepositoryConfigurationSourceReturns the configured postfix to be used for looking up custom implementation classes.- Returns:
- the postfix to use or
Optional.empty()in case none is configured.
-
getRepositoryFactoryBeanName
-
getRepositoryBaseClassName
Description copied from interface:RepositoryConfigurationSourceReturns the name of the repository base class to be used orOptional.empty()if the store specific defaults shall be applied.- Returns:
-
getRepositoryFactoryBeanClassName
Description copied from interface:RepositoryConfigurationSourceReturns the name of the repository factory bean class orOptional.empty()if not defined in the source.- Returns:
-
shouldConsiderNestedRepositories
public boolean shouldConsiderNestedRepositories()Description copied from class:RepositoryConfigurationSourceSupportReturns whether we should consider nested repositories, i.e. repository interface definitions nested in other classes.- Overrides:
shouldConsiderNestedRepositoriesin classRepositoryConfigurationSourceSupport- Returns:
- true if the container should look for nested repository interface definitions.
-
getAttribute
Description copied from interface:RepositoryConfigurationSourceReturns the value for theStringattribute with the given name. The name is expected to be handed in camel-case.- Parameters:
name- must not be null or empty.- Returns:
- the attribute with the given name or
Optional.empty()if not configured or empty.
-
getAttribute
Description copied from interface:RepositoryConfigurationSourceReturns the value for the attribute with the given name and type. The name is expected to be handed in camel-case.- Parameters:
name- must not be null or empty.type- the type of the attribute to look up.- Returns:
- the attribute with the given name or
Optional.empty()if not configured or empty.
-
usesExplicitFilters
public boolean usesExplicitFilters()Description copied from interface:RepositoryConfigurationSourceReturns whether the configuration uses explicit filtering to scan for repository types.- Returns:
- whether the configuration uses explicit filtering to scan for repository types.
-
getBootstrapMode
Description copied from interface:RepositoryConfigurationSourceDefines the repositoryBootstrapModeto be used.- Returns:
-
getResourceDescription
Description copied from interface:RepositoryConfigurationSourceReturns a human readable description of the repository configuration source for error reporting purposes.- Returns:
- can be null.
-