public class AutoConfigurationImportSelector extends Object implements DeferredImportSelector, BeanClassLoaderAware, ResourceLoaderAware, BeanFactoryAware, EnvironmentAware, 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 |
DeferredImportSelector.GroupHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AutoConfigurationImportSelector() |
public String[] selectImports(AnnotationMetadata annotationMetadata)
selectImports in interface ImportSelectorpublic Predicate<String> getExclusionFilter()
getExclusionFilter in interface ImportSelectorprotected AutoConfigurationImportSelector.AutoConfigurationEntry getAutoConfigurationEntry(AnnotationMetadata annotationMetadata)
AutoConfigurationImportSelector.AutoConfigurationEntry based on the AnnotationMetadata
of the importing @Configuration class.annotationMetadata - the annotation metadata of the configuration classpublic Class<? extends DeferredImportSelector.Group> getImportGroup()
getImportGroup in interface DeferredImportSelectorprotected boolean isEnabled(AnnotationMetadata metadata)
protected AnnotationAttributes getAttributes(AnnotationMetadata metadata)
AnnotationAttributes from the
AnnotationMetadata. By default this method will return attributes for
getAnnotationClass().metadata - the annotation metadataprotected Class<?> getAnnotationClass()
protected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes)
SpringFactoriesLoader with
getSpringFactoriesLoaderFactoryClass().metadata - the source metadataattributes - the annotation
attributesprotected Class<?> getSpringFactoriesLoaderFactoryClass()
SpringFactoriesLoader to load configuration
candidates.protected void handleInvalidExcludes(List<String> invalidExcludes)
invalidExcludes - the list of invalid excludes (will always have at least one
element)protected Set<String> getExclusions(AnnotationMetadata metadata, AnnotationAttributes attributes)
metadata - the source metadataattributes - the annotation
attributesprotected List<String> getExcludeAutoConfigurationsProperty()
spring.autoconfigure.exclude property.protected List<AutoConfigurationImportFilter> getAutoConfigurationImportFilters()
protected final List<String> asList(AnnotationAttributes attributes, String name)
protected List<AutoConfigurationImportListener> getAutoConfigurationImportListeners()
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionprotected final ConfigurableListableBeanFactory getBeanFactory()
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwareprotected ClassLoader getBeanClassLoader()
public void setEnvironment(Environment environment)
setEnvironment in interface EnvironmentAwareprotected final Environment getEnvironment()
public void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader in interface ResourceLoaderAwareprotected final ResourceLoader getResourceLoader()