public abstract class RepositoryConfigurationExtensionSupport extends Object implements RepositoryConfigurationExtension
RepositoryConfigurationExtension
to ease the implementation of the interface. Will
default the default named query location based on a module prefix provided by implementors (see
getModulePrefix()
). Stubs out the post-processing methods as they might not be needed by default.Modifier and Type | Field and Description |
---|---|
protected static String |
REPOSITORY_INTERFACE_POST_PROCESSOR |
Constructor and Description |
---|
RepositoryConfigurationExtensionSupport() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultNamedQueryLocation()
Returns the default location of the Spring Data named queries.
|
protected abstract String |
getModulePrefix()
Returns the prefix of the module to be used to create the default location for Spring Data named queries.
|
protected <T extends RepositoryConfigurationSource> |
getRepositoryConfiguration(org.springframework.beans.factory.config.BeanDefinition definition,
T configSource)
Creates a actual
RepositoryConfiguration instance for the given RepositoryConfigurationSource and
interface name. |
<T extends RepositoryConfigurationSource> |
getRepositoryConfigurations(T configSource,
org.springframework.core.io.ResourceLoader loader)
Returns all
RepositoryConfiguration s obtained through the given RepositoryConfigurationSource . |
static boolean |
hasBean(Class<?> type,
org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
Returns whether the given
BeanDefinitionRegistry already contains a bean of the given type assuming the
bean name has been autogenerated. |
void |
postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
AnnotationRepositoryConfigurationSource config)
Callback to post process the
BeanDefinition built from annotations and tweak the configuration if
necessary. |
void |
postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
RepositoryConfigurationSource source)
Callback to post process the
BeanDefinition and tweak the configuration if necessary. |
void |
postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
XmlRepositoryConfigurationSource config)
Callback to post process the
BeanDefinition built from XML and tweak the configuration if necessary. |
void |
registerBeansForRoot(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
RepositoryConfigurationSource configurationSource)
Callback to register additional bean definitions for a repositories root node.
|
static String |
registerWithSourceAndGeneratedBeanName(org.springframework.beans.factory.support.BeanDefinitionRegistry registry,
org.springframework.beans.factory.support.AbstractBeanDefinition bean,
Object source)
Sets the given source on the given
AbstractBeanDefinition and registers it inside the given
BeanDefinitionRegistry . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRepositoryFactoryClassName
protected static final String REPOSITORY_INTERFACE_POST_PROCESSOR
public RepositoryConfigurationExtensionSupport()
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(T configSource, org.springframework.core.io.ResourceLoader loader)
RepositoryConfigurationExtension
RepositoryConfiguration
s obtained through the given RepositoryConfigurationSource
.getRepositoryConfigurations
in interface RepositoryConfigurationExtension
configSource
- must not be null.loader
- must not be null.public String getDefaultNamedQueryLocation()
RepositoryConfigurationExtension
getDefaultNamedQueryLocation
in interface RepositoryConfigurationExtension
public void registerBeansForRoot(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource)
RepositoryConfigurationExtension
registerBeansForRoot
in interface RepositoryConfigurationExtension
protected abstract String getModulePrefix()
public void postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, RepositoryConfigurationSource source)
RepositoryConfigurationExtension
BeanDefinition
and tweak the configuration if necessary.postProcess
in interface RepositoryConfigurationExtension
builder
- will never be null.source
- will never be null.public void postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config)
RepositoryConfigurationExtension
BeanDefinition
built from annotations and tweak the configuration if
necessary.postProcess
in interface RepositoryConfigurationExtension
builder
- will never be null.config
- will never be null.public void postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config)
RepositoryConfigurationExtension
BeanDefinition
built from XML and tweak the configuration if necessary.postProcess
in interface RepositoryConfigurationExtension
builder
- will never be null.config
- will never be null.public static String registerWithSourceAndGeneratedBeanName(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, org.springframework.beans.factory.support.AbstractBeanDefinition bean, Object source)
AbstractBeanDefinition
and registers it inside the given
BeanDefinitionRegistry
.registry
- bean
- source
- public static boolean hasBean(Class<?> type, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
BeanDefinitionRegistry
already contains a bean of the given type assuming the
bean name has been autogenerated.type
- registry
- protected <T extends RepositoryConfigurationSource> RepositoryConfiguration<T> getRepositoryConfiguration(org.springframework.beans.factory.config.BeanDefinition definition, T configSource)
RepositoryConfiguration
instance for the given RepositoryConfigurationSource
and
interface name. Defaults to the DefaultRepositoryConfiguration
but allows sub-classes to override this to
customize the behaviour.definition
- will never be null or empty.configSource
- will never be null.Copyright © 2016. All rights reserved.