类 AnnotationConfigContextLoaderUtils
java.lang.Object
cn.taketoday.test.context.support.AnnotationConfigContextLoaderUtils
Utility methods for
SmartContextLoaders that deal
with component classes (e.g., @Configuration classes).- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Class<?>[]detectDefaultConfigurationClasses(Class<?> declaringClass) Detect the default configuration classes for the supplied test class.private static booleanisDefaultConfigurationClassCandidate(Class<?> clazz) Determine if the suppliedClassmeets the criteria for being considered a default configuration class candidate.private static booleanisStaticNonPrivateAndNonFinal(Class<?> clazz)
-
字段详细资料
-
logger
private static final cn.taketoday.logging.Logger logger
-
-
构造器详细资料
-
AnnotationConfigContextLoaderUtils
public AnnotationConfigContextLoaderUtils()
-
-
方法详细资料
-
detectDefaultConfigurationClasses
Detect the default configuration classes for the supplied test class.The returned class array will contain all static nested classes of the supplied class that meet the requirements for
@Configurationclass implementations as specified in the documentation for@Configuration.The implementation of this method adheres to the contract defined in the
SmartContextLoaderSPI. Specifically, this method uses introspection to detect default configuration classes that comply with the constraints required of@Configurationclass implementations. If a potential candidate configuration class does not meet these requirements, this method will log a debug message, and the potential candidate class will be ignored.- 参数:
declaringClass- the test class that declared@ContextConfiguration- 返回:
- an array of default configuration classes, potentially empty but
never
null
-
isDefaultConfigurationClassCandidate
Determine if the suppliedClassmeets the criteria for being considered a default configuration class candidate.Specifically, such candidates:
- must not be
null - must not be
private - must not be
final - must be
static - must be annotated or meta-annotated with
@Configuration
- 参数:
clazz- the class to check- 返回:
trueif the supplied class meets the candidate criteria
- must not be
-
isStaticNonPrivateAndNonFinal
-