类 AutoConfigurationImportSelector
java.lang.Object
cn.taketoday.context.annotation.config.AutoConfigurationImportSelector
- 所有已实现的接口:
Aware,BeanClassLoaderAware,BeanFactoryAware,DeferredImportSelector,EnvironmentAware,ResourceLoaderAware,ImportSelector,cn.taketoday.core.Ordered
public class AutoConfigurationImportSelector
extends Object
implements DeferredImportSelector, BeanClassLoaderAware, ResourceLoaderAware, BeanFactoryAware, EnvironmentAware, cn.taketoday.core.Ordered
DeferredImportSelector to handle auto-configuration. This class can also be subclassed if a custom variant of
@EnableAutoConfiguration is needed.- 从以下版本开始:
- 4.0 2022/2/1 02:37
- 作者:
- Phillip Webb, Andy Wilkinson, Stephane Nicoll, Madhura Bhave, Harry Yang
- 另请参阅:
-
嵌套类概要
嵌套类从接口继承的嵌套类/接口 cn.taketoday.context.annotation.DeferredImportSelector
DeferredImportSelector.Group -
字段概要
从接口继承的字段 cn.taketoday.context.loader.ImportSelector
NO_IMPORTS从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected Class<?>Return the source annotation class used by the selector.protected cn.taketoday.core.annotation.AnnotationAttributesgetAttributes(cn.taketoday.core.type.AnnotationMetadata metadata) Return the appropriateAnnotationAttributesfrom theAnnotationMetadata.getAutoConfigurationEntry(cn.taketoday.core.type.AnnotationMetadata annotationMetadata) Return theAutoConfigurationImportSelector.AutoConfigurationEntrybased on theAnnotationMetadataof the importing@Configurationclass.protected List<AutoConfigurationImportFilter>protected List<AutoConfigurationImportListener>protected ClassLoaderprotected final ConfigurableBeanFactorygetCandidateConfigurations(cn.taketoday.core.type.AnnotationMetadata metadata, cn.taketoday.core.annotation.AnnotationAttributes attributes) Return the auto-configuration class names that should be considered.protected final cn.taketoday.core.env.EnvironmentReturns the auto-configurations excluded by thecontext.autoconfigure.excludeproperty.Return a predicate for excluding classes from the import candidates, to be transitively applied to all classes found through this selector's imports.getExclusions(cn.taketoday.core.type.AnnotationMetadata metadata, cn.taketoday.core.annotation.AnnotationAttributes attributes) Return any exclusions that limit the candidate configurations.Class<? extends DeferredImportSelector.Group>Return a specific import group.intgetOrder()protected final cn.taketoday.core.io.ResourceLoaderprotected Class<?>Return the class used byTodayStrategiesto load configuration candidates.protected voidhandleInvalidExcludes(List<String> invalidExcludes) Handle any invalid excludes that have been specified.protected booleanisEnabled(cn.taketoday.core.type.AnnotationMetadata metadata) protected final <T> List<T>removeDuplicates(List<T> list) String[]selectImports(cn.taketoday.core.type.AnnotationMetadata annotationMetadata) Select and return the names of which class(es) should be imported based on theAnnotationMetadataof the importing @Configurationclass.voidsetBeanClassLoader(ClassLoader classLoader) voidsetBeanFactory(BeanFactory beanFactory) voidsetEnvironment(cn.taketoday.core.env.Environment environment) voidsetResourceLoader(cn.taketoday.core.io.ResourceLoader resourceLoader) Set the ResourceLoader that this object runs in.
-
构造器详细资料
-
AutoConfigurationImportSelector
public AutoConfigurationImportSelector()
-
-
方法详细资料
-
selectImports
从接口复制的说明:ImportSelectorSelect and return the names of which class(es) should be imported based on theAnnotationMetadataof the importing @Configurationclass.- 指定者:
selectImports在接口中ImportSelector- 返回:
- the class names, or an empty array if none
-
getExclusionFilter
从接口复制的说明:ImportSelectorReturn a predicate for excluding classes from the import candidates, to be transitively applied to all classes found through this selector's imports.If this predicate returns
truefor a given fully-qualified class name, said class will not be considered as an imported configuration class, bypassing class file loading as well as metadata introspection.- 指定者:
getExclusionFilter在接口中ImportSelector- 返回:
- the filter predicate for fully-qualified candidate class names
of transitively imported configuration classes, or
nullif none
-
getAutoConfigurationEntry
protected AutoConfigurationImportSelector.AutoConfigurationEntry getAutoConfigurationEntry(cn.taketoday.core.type.AnnotationMetadata annotationMetadata) Return theAutoConfigurationImportSelector.AutoConfigurationEntrybased on theAnnotationMetadataof the importing@Configurationclass.- 参数:
annotationMetadata- the annotation metadata of the configuration class- 返回:
- the auto-configurations that should be imported
-
getImportGroup
从接口复制的说明:DeferredImportSelectorReturn a specific import group.The default implementations return
nullfor no grouping required.- 指定者:
getImportGroup在接口中DeferredImportSelector- 返回:
- the import group class, or
nullif none
-
isEnabled
protected boolean isEnabled(cn.taketoday.core.type.AnnotationMetadata metadata) -
getAttributes
@Nullable protected cn.taketoday.core.annotation.AnnotationAttributes getAttributes(cn.taketoday.core.type.AnnotationMetadata metadata) Return the appropriateAnnotationAttributesfrom theAnnotationMetadata. By default this method will return attributes forgetAnnotationClass().- 参数:
metadata- the annotation metadata- 返回:
- annotation attributes
-
getAnnotationClass
Return the source annotation class used by the selector.- 返回:
- the annotation class
-
getCandidateConfigurations
protected List<String> getCandidateConfigurations(cn.taketoday.core.type.AnnotationMetadata metadata, @Nullable cn.taketoday.core.annotation.AnnotationAttributes attributes) Return the auto-configuration class names that should be considered. By default this method will load candidates usingTodayStrategieswithgetStrategyClass().- 参数:
metadata- the source metadataattributes- theannotation attributes- 返回:
- a list of candidate configurations
-
getStrategyClass
Return the class used byTodayStrategiesto load configuration candidates.- 返回:
- the strategy class
-
handleInvalidExcludes
Handle any invalid excludes that have been specified.- 参数:
invalidExcludes- the list of invalid excludes (will always have at least one element)
-
getExclusions
protected Set<String> getExclusions(cn.taketoday.core.type.AnnotationMetadata metadata, @Nullable cn.taketoday.core.annotation.AnnotationAttributes attributes) Return any exclusions that limit the candidate configurations.- 参数:
metadata- the source metadataattributes- theannotation attributes- 返回:
- exclusions or an empty set
-
getExcludeAutoConfigurationsProperty
Returns the auto-configurations excluded by thecontext.autoconfigure.excludeproperty.- 返回:
- excluded auto-configurations
-
getAutoConfigurationImportFilters
-
removeDuplicates
-
asList
-
getAutoConfigurationImportListeners
-
setBeanFactory
- 指定者:
setBeanFactory在接口中BeanFactoryAware- 抛出:
BeansException
-
getBeanFactory
-
setBeanClassLoader
- 指定者:
setBeanClassLoader在接口中BeanClassLoaderAware
-
getBeanClassLoader
-
setEnvironment
public void setEnvironment(cn.taketoday.core.env.Environment environment) - 指定者:
setEnvironment在接口中EnvironmentAware
-
getEnvironment
protected final cn.taketoday.core.env.Environment getEnvironment() -
setResourceLoader
public void setResourceLoader(cn.taketoday.core.io.ResourceLoader resourceLoader) 从接口复制的说明:ResourceLoaderAwareSet the ResourceLoader that this object runs in.This might be a ResourcePatternResolver, which can be checked through
instanceof ResourcePatternResolver. See also theResourcePatternUtils.getResourcePatternResolvermethod.Invoked after population of normal bean properties but before an init callback like InitializingBean's
afterPropertiesSetor a custom init-method. Invoked before ApplicationContextAware'ssetApplicationContext.- 指定者:
setResourceLoader在接口中ResourceLoaderAware- 参数:
resourceLoader- the ResourceLoader object to be used by this object- 另请参阅:
-
PatternResourceLoaderPatternResourceLoader.fromResourceLoader(cn.taketoday.core.io.ResourceLoader)
-
getResourceLoader
protected final cn.taketoday.core.io.ResourceLoader getResourceLoader() -
getOrder
public int getOrder()- 指定者:
getOrder在接口中cn.taketoday.core.Ordered
-