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(BeanDefinition definition,
T configSource)
Creates a actual
RepositoryConfiguration instance for the given RepositoryConfigurationSource and
interface name. |
<T extends RepositoryConfigurationSource> |
getRepositoryConfigurations(T configSource,
ResourceLoader loader)
Returns all
RepositoryConfigurations obtained through the given RepositoryConfigurationSource. |
static boolean |
hasBean(Class<?> type,
BeanDefinitionRegistry registry)
Returns whether the given
BeanDefinitionRegistry already contains a bean of the given type assuming the
bean name has been autogenerated. |
void |
postProcess(BeanDefinitionBuilder builder,
AnnotationRepositoryConfigurationSource config)
Callback to post process the
BeanDefinition built from annotations and tweak the configuration if
necessary. |
void |
postProcess(BeanDefinitionBuilder builder,
RepositoryConfigurationSource source)
Callback to post process the
BeanDefinition and tweak the configuration if necessary. |
void |
postProcess(BeanDefinitionBuilder builder,
XmlRepositoryConfigurationSource config)
Callback to post process the
BeanDefinition built from XML and tweak the configuration if necessary. |
void |
registerBeansForRoot(BeanDefinitionRegistry registry,
RepositoryConfigurationSource configurationSource)
Callback to register additional bean definitions for a repositories root node.
|
static String |
registerWithSourceAndGeneratedBeanName(BeanDefinitionRegistry registry,
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, waitgetRepositoryFactoryClassNameprotected static final String REPOSITORY_INTERFACE_POST_PROCESSOR
public RepositoryConfigurationExtensionSupport()
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(T configSource, ResourceLoader loader)
RepositoryConfigurationExtensionRepositoryConfigurations obtained through the given RepositoryConfigurationSource.getRepositoryConfigurations in interface RepositoryConfigurationExtensionconfigSource - must not be null.loader - must not be null.public String getDefaultNamedQueryLocation()
RepositoryConfigurationExtensiongetDefaultNamedQueryLocation in interface RepositoryConfigurationExtensionpublic void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource)
RepositoryConfigurationExtensionregisterBeansForRoot in interface RepositoryConfigurationExtensionprotected abstract String getModulePrefix()
public void postProcess(BeanDefinitionBuilder builder, RepositoryConfigurationSource source)
RepositoryConfigurationExtensionBeanDefinition and tweak the configuration if necessary.postProcess in interface RepositoryConfigurationExtensionbuilder - will never be null.source - will never be null.public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config)
RepositoryConfigurationExtensionBeanDefinition built from annotations and tweak the configuration if
necessary.postProcess in interface RepositoryConfigurationExtensionbuilder - will never be null.config - will never be null.public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config)
RepositoryConfigurationExtensionBeanDefinition built from XML and tweak the configuration if necessary.postProcess in interface RepositoryConfigurationExtensionbuilder - will never be null.config - will never be null.public static String registerWithSourceAndGeneratedBeanName(BeanDefinitionRegistry registry, AbstractBeanDefinition bean, Object source)
AbstractBeanDefinition and registers it inside the given
BeanDefinitionRegistry.registry - bean - source - public static boolean hasBean(Class<?> type, 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(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 © 2011-2014–2015 Pivotal Software, Inc.. All rights reserved.