类 AnnotationConfigContextLoader
- 所有已实现的接口:
AotContextLoader,ContextLoader,SmartContextLoader
AbstractGenericContextLoader that loads
bean definitions from component classes.
See the Javadoc for
@ContextConfiguration
for a definition of component class.
Note: AnnotationConfigContextLoader supports component classes
rather than the String-based resource locations defined by the legacy
ContextLoader API. Thus,
although AnnotationConfigContextLoader extends
AbstractGenericContextLoader, AnnotationConfigContextLoader
does not support any String-based methods defined by
AbstractContextLoader or AbstractGenericContextLoader.
Consequently, AnnotationConfigContextLoader should chiefly be
considered a SmartContextLoader
rather than a ContextLoader.
-
字段概要
字段从类继承的字段 cn.taketoday.test.context.support.AbstractGenericContextLoader
log -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明classNames(Class<?>... classes) protected cn.taketoday.beans.factory.support.BeanDefinitionReadercreateBeanDefinitionReader(cn.taketoday.context.support.GenericApplicationContext context) AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader.protected Class<?>[]detectDefaultConfigurationClasses(Class<?> declaringClass) Detect the default configuration classes for the supplied test class.protected String[]generateDefaultLocations(Class<?> clazz) AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader.protected StringAnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader.protected voidloadBeanDefinitions(cn.taketoday.context.support.GenericApplicationContext context, MergedContextConfiguration mergedConfig) Register classes in the suppliedcontextfrom the classes in the suppliedMergedContextConfiguration.protected String[]modifyLocations(Class<?> clazz, String... locations) AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader.voidprocessContextConfiguration(ContextConfigurationAttributes configAttributes) Process component classes in the suppliedContextConfigurationAttributes.protected voidvalidateMergedContextConfiguration(MergedContextConfiguration mergedConfig) Ensure that the suppliedMergedContextConfigurationdoes not containlocations.从类继承的方法 cn.taketoday.test.context.support.AbstractGenericContextLoader
createContext, customizeBeanFactory, customizeContext, loadContext, loadContext, loadContextForAotProcessing, loadContextForAotRuntime, prepareContext从类继承的方法 cn.taketoday.test.context.support.AbstractContextLoader
customizeContext, getResourceSuffixes, isGenerateDefaultLocations, prepareContext, processLocations从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.test.context.SmartContextLoader
processLocations
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
AnnotationConfigContextLoader
public AnnotationConfigContextLoader()
-
-
方法详细资料
-
processContextConfiguration
Process component classes in the suppliedContextConfigurationAttributes.If the component classes are
nullor empty andAbstractContextLoader.isGenerateDefaultLocations()returnstrue, thisSmartContextLoaderwill attempt todetect default configuration classes. If defaults are detected they will besetin the supplied configuration attributes. Otherwise, properties in the supplied configuration attributes will not be modified.- 指定者:
processContextConfiguration在接口中SmartContextLoader- 覆盖:
processContextConfiguration在类中AbstractContextLoader- 参数:
configAttributes- the context configuration attributes to process- 另请参阅:
-
detectDefaultConfigurationClasses
Detect the default configuration classes for the supplied test class.The default implementation simply delegates to
AnnotationConfigContextLoaderUtils.detectDefaultConfigurationClasses(Class).- 参数:
declaringClass- the test class that declared@ContextConfiguration- 返回:
- an array of default configuration classes, potentially empty but
never
null - 另请参阅:
-
modifyLocations
AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader. Consequently, this method is not supported.- 覆盖:
modifyLocations在类中AbstractContextLoader- 参数:
clazz- the class with which the locations are associatedlocations- the resource locations to be modified- 返回:
- an array of modified application context resource locations
- 抛出:
UnsupportedOperationException- in this implementation- 另请参阅:
-
generateDefaultLocations
AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader. Consequently, this method is not supported.- 覆盖:
generateDefaultLocations在类中AbstractContextLoader- 参数:
clazz- the class for which the default locations are to be generated- 返回:
- an array of default application context resource locations
- 抛出:
UnsupportedOperationException- in this implementation- 另请参阅:
-
getResourceSuffix
AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader. Consequently, this method is not supported.- 指定者:
getResourceSuffix在类中AbstractContextLoader- 返回:
- the resource suffix; never
nullor empty - 抛出:
UnsupportedOperationException- in this implementation- 另请参阅:
-
validateMergedContextConfiguration
Ensure that the suppliedMergedContextConfigurationdoes not containlocations.- 覆盖:
validateMergedContextConfiguration在类中AbstractGenericContextLoader- 参数:
mergedConfig- the merged configuration to validate- 另请参阅:
-
loadBeanDefinitions
protected void loadBeanDefinitions(cn.taketoday.context.support.GenericApplicationContext context, MergedContextConfiguration mergedConfig) Register classes in the suppliedcontextfrom the classes in the suppliedMergedContextConfiguration.Each class must represent a component class. An
AnnotatedBeanDefinitionReaderis used to register the appropriate bean definitions.Note that this method does not call
createBeanDefinitionReader(cn.taketoday.context.support.GenericApplicationContext)sinceAnnotatedBeanDefinitionReaderis not an instance ofBeanDefinitionReader.- 覆盖:
loadBeanDefinitions在类中AbstractGenericContextLoader- 参数:
context- the context in which the component classes should be registeredmergedConfig- the merged configuration from which the classes should be retrieved- 另请参阅:
-
classNames
-
createBeanDefinitionReader
protected cn.taketoday.beans.factory.support.BeanDefinitionReader createBeanDefinitionReader(cn.taketoday.context.support.GenericApplicationContext context) AnnotationConfigContextLoadershould be used as aSmartContextLoader, not as a legacyContextLoader. Consequently, this method is not supported.- 指定者:
createBeanDefinitionReader在类中AbstractGenericContextLoader- 参数:
context- the context for which theBeanDefinitionReadershould be created- 返回:
- a
BeanDefinitionReaderfor the supplied context - 抛出:
UnsupportedOperationException- in this implementation- 另请参阅:
-