类 AnnotationConfigApplicationContext
java.lang.Object
cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.context.support.AbstractApplicationContext
cn.taketoday.context.support.GenericApplicationContext
cn.taketoday.context.support.StandardApplicationContext
cn.taketoday.context.annotation.AnnotationConfigApplicationContext
- 所有已实现的接口:
BeanFactory,HierarchicalBeanFactory,BeanDefinitionRegistry,DependencyInjectorProvider,AnnotationConfigRegistry,ApplicationContext,ApplicationEventPublisher,ConfigurableApplicationContext,Lifecycle,MessageSource,cn.taketoday.core.AliasRegistry,cn.taketoday.core.env.EnvironmentCapable,cn.taketoday.core.io.PatternResourceLoader,cn.taketoday.core.io.ResourceLoader,Closeable,AutoCloseable
Standalone application context, accepting component classes as input —
in particular
@Configuration-annotated classes, but also plain
@Component types and JSR-330 compliant
classes using jakarta.inject annotations.
Allows for registering classes one by one using StandardApplicationContext.register(Class...)
as well as for classpath scanning using StandardApplicationContext.scan(String...).
In case of multiple @Configuration classes, @Component methods
defined in later classes will override those defined in earlier classes. This can
be leveraged to deliberately override certain bean definitions via an extra
@Configuration class.
See @Configuration's javadoc for usage examples.
- 从以下版本开始:
- 4.0 2022/2/20 21:24
- 作者:
- Juergen Hoeller, Chris Beams, Harry Yang
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.core.io.DefaultResourceLoader
cn.taketoday.core.io.DefaultResourceLoader.ClassPathContextResource从接口继承的嵌套类/接口 cn.taketoday.context.ApplicationContext
ApplicationContext.State -
字段概要
从类继承的字段 cn.taketoday.context.support.GenericApplicationContext
beanFactory从类继承的字段 cn.taketoday.context.support.AbstractApplicationContext
APPLICATION_EVENT_MULTICASTER_BEAN_NAME, LIFECYCLE_PROCESSOR_BEAN_NAME, log, MESSAGE_SOURCE_BEAN_NAME从接口继承的字段 cn.taketoday.context.ApplicationContext
APPLICATION_NAME从接口继承的字段 cn.taketoday.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX从接口继承的字段 cn.taketoday.context.ConfigurableApplicationContext
CONFIG_LOCATION_DELIMITERS, CONVERSION_SERVICE_BEAN_NAME, LOAD_TIME_WEAVER_BEAN_NAME, SHUTDOWN_HOOK_THREAD_NAME从接口继承的字段 cn.taketoday.core.io.PatternResourceLoader
CLASSPATH_ALL_URL_PREFIX从接口继承的字段 cn.taketoday.core.io.ResourceLoader
CLASSPATH_URL_PREFIX -
构造器概要
构造器构造器说明Create a new AnnotationConfigApplicationContext that needs to be populated throughStandardApplicationContext.register(java.lang.Class<?>...)calls and then manually refreshed.AnnotationConfigApplicationContext(StandardBeanFactory beanFactory) Create a new AnnotationConfigApplicationContext with the given DefaultListableBeanFactory.AnnotationConfigApplicationContext(StandardBeanFactory beanFactory, ApplicationContext parent) AnnotationConfigApplicationContext(Class<?>... components) Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given component classes and automatically refreshing the context.AnnotationConfigApplicationContext(String... basePackages) Create a new AnnotationConfigApplicationContext, scanning for components in the given packages, registering bean definitions for those components, and automatically refreshing the context. -
方法概要
从类继承的方法 cn.taketoday.context.support.StandardApplicationContext
register, registerBean, scan, setBeanNameGenerator, setEnvironment, setScopeMetadataResolver从类继承的方法 cn.taketoday.context.support.GenericApplicationContext
cancelRefresh, closeBeanFactory, containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, createBootstrapContext, getAliasList, getAutowireCapableBeanFactory, getBeanDefinition, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanFactory, getClassLoader, getResource, getResources, isAlias, isAllowBeanDefinitionOverriding, isBeanNameInUse, refreshBeanFactory, registerAlias, registerBean, registerBean, registerBean, registerBean, registerBean, registerBeanDefinition, registerPrototype, registerPrototype, registerSingleton, registerSingleton, registerSingleton, registerSingleton, removeAlias, removeBeanDefinition, scan, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setClassLoader, setParent, setResourceLoader从类继承的方法 cn.taketoday.context.support.AbstractApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addFactoryPostProcessors, applyState, assertBeanFactoryActive, close, containsBean, containsLocalBean, createEnvironment, destroyBeans, doClose, findAnnotationOnBean, findAnnotationOnBean, findSynthesizedAnnotation, finishBeanFactoryInitialization, finishRefresh, formatStartupDate, getAliases, getAnnotatedBeans, getApplicationEventMulticaster, getApplicationListeners, getApplicationName, getBean, getBean, getBean, getBean, getBean, getBeanDefinitions, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeans, getBeansOfType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getBeansWithAnnotation, getBootstrapContext, getDisplayName, getEnvironment, getExpressionEvaluator, getFactoryPostProcessors, getId, getInjector, getInternalParentBeanFactory, getInternalParentMessageSource, getLifecycleProcessor, getMessage, getMessage, getMessage, getObjectSupplier, getObjectSupplier, getObjectSupplier, getObjectSupplier, getParent, getParentBeanFactory, getPatternResourceLoader, getStartupDate, getState, getType, getType, hasStarted, initApplicationEventMulticaster, initLifecycleProcessor, initMessageSource, initPropertySources, invokeBeanFactoryPostProcessors, isActive, isPrototype, isRunning, isSingleton, isTypeMatch, isTypeMatch, obtainBootstrapContext, obtainFreshBeanFactory, onClose, onRefresh, postProcessBeanFactory, prepareBeanFactory, prepareRefresh, publishEvent, publishEvent, refresh, registerApplicationListeners, registerBeanPostProcessors, registerFrameworkComponents, registerShutdownHook, removeApplicationListener, resetCommonCaches, setBootstrapContext, setDisplayName, setId, setLifecycleProcessor, start, stop, toString, unwrapFactory从类继承的方法 cn.taketoday.core.io.DefaultResourceLoader
addProtocolResolver, clearResourceCaches, getProtocolResolvers, getResourceByPath, getResourceCache从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.core.AliasRegistry
getAliases, getAliasList, isAlias, registerAlias, removeAlias从接口继承的方法 cn.taketoday.context.ApplicationContext
getApplicationName, getAutowireCapableBeanFactory, getDisplayName, getExpressionEvaluator, getId, getParent, getStartupDate, getState, hasStarted, unwrapFactory从接口继承的方法 cn.taketoday.context.ApplicationEventPublisher
publishEvent从接口继承的方法 cn.taketoday.beans.factory.support.BeanDefinitionRegistry
containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, containsBeanDefinition, getBeanDefinition, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitions, isAllowBeanDefinitionOverriding, isBeanNameInUse, registerBeanDefinition, removeBeanDefinition从接口继承的方法 cn.taketoday.beans.factory.BeanFactory
containsBean, containsBeanDefinition, findAnnotationOnBean, findAnnotationOnBean, findSynthesizedAnnotation, getAliases, getAnnotatedBeans, getBean, getBean, getBean, getBean, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanDefinitions, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeans, getBeansOfType, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getBeansWithAnnotation, getObjectSupplier, getObjectSupplier, getObjectSupplier, getObjectSupplier, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch, unwrap从接口继承的方法 cn.taketoday.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, addProtocolResolver, close, getBeanFactory, getEnvironment, isActive, refresh, registerShutdownHook, removeApplicationListener, setClassLoader, setId, setParent从接口继承的方法 cn.taketoday.beans.factory.support.DependencyInjectorProvider
getInjector从接口继承的方法 cn.taketoday.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory从接口继承的方法 cn.taketoday.context.MessageSource
getMessage, getMessage, getMessage从接口继承的方法 cn.taketoday.core.io.PatternResourceLoader
getResources, getResourcesArray, scan从接口继承的方法 cn.taketoday.core.io.ResourceLoader
getClassLoader, getResource
-
构造器详细资料
-
AnnotationConfigApplicationContext
public AnnotationConfigApplicationContext()Create a new AnnotationConfigApplicationContext that needs to be populated throughStandardApplicationContext.register(java.lang.Class<?>...)calls and then manually refreshed. -
AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext with the given DefaultListableBeanFactory.- 参数:
beanFactory- the DefaultListableBeanFactory instance to use for this context
-
AnnotationConfigApplicationContext
-
AnnotationConfigApplicationContext
public AnnotationConfigApplicationContext(StandardBeanFactory beanFactory, ApplicationContext parent) -
AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext, deriving bean definitions from the given component classes and automatically refreshing the context.- 参数:
components- one or more component classes — for example,@Configurationclasses
-
AnnotationConfigApplicationContext
Create a new AnnotationConfigApplicationContext, scanning for components in the given packages, registering bean definitions for those components, and automatically refreshing the context.- 参数:
basePackages- the packages to scan for component classes
-