public class AutoConfigurationImportSelector
extends java.lang.Object
implements org.springframework.context.annotation.DeferredImportSelector, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware, org.springframework.core.Ordered
DeferredImportSelector to handle auto-configuration. This class can also be subclassed if a custom variant of
@EnableAutoConfiguration is needed.EnableAutoConfiguration| Modifier and Type | Class and Description |
|---|---|
protected static class |
AutoConfigurationImportSelector.AutoConfigurationEntry |
| Constructor and Description |
|---|
AutoConfigurationImportSelector() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.List<java.lang.String> |
asList(org.springframework.core.annotation.AnnotationAttributes attributes,
java.lang.String name) |
protected java.lang.Class<?> |
getAnnotationClass()
Return the source annotation class used by the selector.
|
protected org.springframework.core.annotation.AnnotationAttributes |
getAttributes(org.springframework.core.type.AnnotationMetadata metadata)
Return the appropriate
AnnotationAttributes from the
AnnotationMetadata. |
protected AutoConfigurationImportSelector.AutoConfigurationEntry |
getAutoConfigurationEntry(org.springframework.core.type.AnnotationMetadata annotationMetadata)
Return the
AutoConfigurationImportSelector.AutoConfigurationEntry based on the AnnotationMetadata
of the importing @Configuration class. |
protected java.util.List<AutoConfigurationImportFilter> |
getAutoConfigurationImportFilters() |
protected java.util.List<AutoConfigurationImportListener> |
getAutoConfigurationImportListeners() |
protected java.lang.ClassLoader |
getBeanClassLoader() |
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory |
getBeanFactory() |
protected java.util.List<java.lang.String> |
getCandidateConfigurations(org.springframework.core.type.AnnotationMetadata metadata,
org.springframework.core.annotation.AnnotationAttributes attributes)
Return the auto-configuration class names that should be considered.
|
protected org.springframework.core.env.Environment |
getEnvironment() |
protected java.util.List<java.lang.String> |
getExcludeAutoConfigurationsProperty()
Returns the auto-configurations excluded by the
spring.autoconfigure.exclude property. |
java.util.function.Predicate<java.lang.String> |
getExclusionFilter() |
protected java.util.Set<java.lang.String> |
getExclusions(org.springframework.core.type.AnnotationMetadata metadata,
org.springframework.core.annotation.AnnotationAttributes attributes)
Return any exclusions that limit the candidate configurations.
|
java.lang.Class<? extends org.springframework.context.annotation.DeferredImportSelector.Group> |
getImportGroup() |
int |
getOrder() |
protected org.springframework.core.io.ResourceLoader |
getResourceLoader() |
protected java.lang.Class<?> |
getSpringFactoriesLoaderFactoryClass()
Return the class used by
SpringFactoriesLoader to load configuration
candidates. |
protected void |
handleInvalidExcludes(java.util.List<java.lang.String> invalidExcludes)
Handle any invalid excludes that have been specified.
|
protected boolean |
isEnabled(org.springframework.core.type.AnnotationMetadata metadata) |
protected <T> java.util.List<T> |
removeDuplicates(java.util.List<T> list) |
java.lang.String[] |
selectImports(org.springframework.core.type.AnnotationMetadata annotationMetadata) |
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setEnvironment(org.springframework.core.env.Environment environment) |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
public java.lang.String[] selectImports(org.springframework.core.type.AnnotationMetadata annotationMetadata)
selectImports in interface org.springframework.context.annotation.ImportSelectorpublic java.util.function.Predicate<java.lang.String> getExclusionFilter()
getExclusionFilter in interface org.springframework.context.annotation.ImportSelectorprotected AutoConfigurationImportSelector.AutoConfigurationEntry getAutoConfigurationEntry(org.springframework.core.type.AnnotationMetadata annotationMetadata)
AutoConfigurationImportSelector.AutoConfigurationEntry based on the AnnotationMetadata
of the importing @Configuration class.annotationMetadata - the annotation metadata of the configuration classpublic java.lang.Class<? extends org.springframework.context.annotation.DeferredImportSelector.Group> getImportGroup()
getImportGroup in interface org.springframework.context.annotation.DeferredImportSelectorprotected boolean isEnabled(org.springframework.core.type.AnnotationMetadata metadata)
protected org.springframework.core.annotation.AnnotationAttributes getAttributes(org.springframework.core.type.AnnotationMetadata metadata)
AnnotationAttributes from the
AnnotationMetadata. By default this method will return attributes for
getAnnotationClass().metadata - the annotation metadataprotected java.lang.Class<?> getAnnotationClass()
protected java.util.List<java.lang.String> getCandidateConfigurations(org.springframework.core.type.AnnotationMetadata metadata,
org.springframework.core.annotation.AnnotationAttributes attributes)
SpringFactoriesLoader with
getSpringFactoriesLoaderFactoryClass().metadata - the source metadataattributes - the annotation
attributesprotected java.lang.Class<?> getSpringFactoriesLoaderFactoryClass()
SpringFactoriesLoader to load configuration
candidates.protected void handleInvalidExcludes(java.util.List<java.lang.String> invalidExcludes)
invalidExcludes - the list of invalid excludes (will always have at least one
element)protected java.util.Set<java.lang.String> getExclusions(org.springframework.core.type.AnnotationMetadata metadata,
org.springframework.core.annotation.AnnotationAttributes attributes)
metadata - the source metadataattributes - the annotation
attributesprotected java.util.List<java.lang.String> getExcludeAutoConfigurationsProperty()
spring.autoconfigure.exclude property.protected java.util.List<AutoConfigurationImportFilter> getAutoConfigurationImportFilters()
protected final <T> java.util.List<T> removeDuplicates(java.util.List<T> list)
protected final java.util.List<java.lang.String> asList(org.springframework.core.annotation.AnnotationAttributes attributes,
java.lang.String name)
protected java.util.List<AutoConfigurationImportListener> getAutoConfigurationImportListeners()
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionprotected final org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAwareprotected java.lang.ClassLoader getBeanClassLoader()
public void setEnvironment(org.springframework.core.env.Environment environment)
setEnvironment in interface org.springframework.context.EnvironmentAwareprotected final org.springframework.core.env.Environment getEnvironment()
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAwareprotected final org.springframework.core.io.ResourceLoader getResourceLoader()
public int getOrder()
getOrder in interface org.springframework.core.Ordered