类 ContextConfigurationAttributes
java.lang.Object
cn.taketoday.test.context.ContextConfigurationAttributes
ContextConfigurationAttributes encapsulates the context configuration
attributes declared via @ContextConfiguration.- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Phillip Webb
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private Class<?>[]private final Class<? extends ContextLoader>private final Class<?>private static final Class<?>[]private static final String[]private final booleanprivate final booleanprivate final Class<? extends cn.taketoday.context.ApplicationContextInitializer>[]private String[]private static final cn.taketoday.logging.Loggerprivate final String -
构造器概要
构造器构造器说明ContextConfigurationAttributes(Class<?> declaringClass) Construct a newContextConfigurationAttributesinstance with default values.ContextConfigurationAttributes(Class<?> declaringClass, cn.taketoday.core.annotation.AnnotationAttributes annAttrs) Construct a newContextConfigurationAttributesinstance for the suppliedAnnotationAttributes(parsed from a@ContextConfigurationannotation) and the test class that declared them.ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration) Construct a newContextConfigurationAttributesinstance for the supplied@ContextConfigurationannotation and the test class that declared it.ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends cn.taketoday.context.ApplicationContextInitializer>[] initializers, boolean inheritInitializers, Class<? extends ContextLoader> contextLoaderClass) Construct a newContextConfigurationAttributesinstance for the test class that declared the@ContextConfigurationannotation and its corresponding attributes.ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends cn.taketoday.context.ApplicationContextInitializer>[] initializers, boolean inheritInitializers, String name, Class<? extends ContextLoader> contextLoaderClass) Construct a newContextConfigurationAttributesinstance for the test class that declared the@ContextConfigurationannotation and its corresponding attributes. -
方法概要
修饰符和类型方法说明booleanDetermine if the supplied object is equal to thisContextConfigurationAttributesinstance by comparing both object's declaring class, locations, annotated classes, inheritLocations flag, context initializer classes, inheritInitializers flag, and theContextLoader class.Class<?>[]Get the annotated classes that were declared via@ContextConfiguration.Class<? extends ContextLoader>Get theContextLoaderclass that was declared via@ContextConfiguration.Class<?>Get the class that declared the@ContextConfigurationannotation, either explicitly or implicitly.Class<? extends cn.taketoday.context.ApplicationContextInitializer>[]Get theApplicationContextInitializerclasses that were declared via@ContextConfiguration.String[]Get the resource locations that were declared via@ContextConfiguration.getName()Get the name of the context hierarchy level that was declared via@ContextConfiguration.booleanDetermine if thisContextConfigurationAttributesinstance has class-based resources.inthashCode()Generate a unique hash code for all properties of thisContextConfigurationAttributesinstance excluding the name.booleanDetermine if thisContextConfigurationAttributesinstance has path-based resource locations.booleanDetermine if thisContextConfigurationAttributesinstance has either path-based resource locations or class-based resources.booleanGet theinheritInitializersflag that was declared via@ContextConfiguration.booleanGet theinheritLocationsflag that was declared via@ContextConfiguration.voidsetClasses(Class<?>... classes) Set the processed annotated classes, effectively overriding the original value declared via@ContextConfiguration.voidsetLocations(String... locations) Set the processed resource locations, effectively overriding the original value declared via@ContextConfiguration.toString()Provide a String representation of the context configuration attributes and declaring class.
-
字段详细资料
-
EMPTY_LOCATIONS
-
EMPTY_CLASSES
-
logger
private static final cn.taketoday.logging.Logger logger -
declaringClass
-
classes
-
locations
-
inheritLocations
private final boolean inheritLocations -
initializers
-
inheritInitializers
private final boolean inheritInitializers -
name
-
contextLoaderClass
-
-
构造器详细资料
-
ContextConfigurationAttributes
Construct a newContextConfigurationAttributesinstance with default values.- 参数:
declaringClass- the test class that declared@ContextConfiguration, either explicitly or implicitly
-
ContextConfigurationAttributes
public ContextConfigurationAttributes(Class<?> declaringClass, ContextConfiguration contextConfiguration) Construct a newContextConfigurationAttributesinstance for the supplied@ContextConfigurationannotation and the test class that declared it.- 参数:
declaringClass- the test class that declared@ContextConfigurationcontextConfiguration- the annotation from which to retrieve the attributes
-
ContextConfigurationAttributes
public ContextConfigurationAttributes(Class<?> declaringClass, cn.taketoday.core.annotation.AnnotationAttributes annAttrs) Construct a newContextConfigurationAttributesinstance for the suppliedAnnotationAttributes(parsed from a@ContextConfigurationannotation) and the test class that declared them.- 参数:
declaringClass- the test class that declared@ContextConfigurationannAttrs- the annotation attributes from which to retrieve the attributes
-
ContextConfigurationAttributes
public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends cn.taketoday.context.ApplicationContextInitializer>[] initializers, boolean inheritInitializers, Class<? extends ContextLoader> contextLoaderClass) Construct a newContextConfigurationAttributesinstance for the test class that declared the@ContextConfigurationannotation and its corresponding attributes.- 参数:
declaringClass- the test class that declared@ContextConfigurationlocations- the resource locations declared via@ContextConfigurationclasses- the annotated classes declared via@ContextConfigurationinheritLocations- theinheritLocationsflag declared via@ContextConfigurationinitializers- the context initializers declared via@ContextConfigurationinheritInitializers- theinheritInitializersflag declared via@ContextConfigurationcontextLoaderClass- theContextLoaderclass declared via@ContextConfiguration- 抛出:
IllegalArgumentException- if thedeclaringClassorcontextLoaderClassisnull
-
ContextConfigurationAttributes
public ContextConfigurationAttributes(Class<?> declaringClass, String[] locations, Class<?>[] classes, boolean inheritLocations, Class<? extends cn.taketoday.context.ApplicationContextInitializer>[] initializers, boolean inheritInitializers, @Nullable String name, Class<? extends ContextLoader> contextLoaderClass) Construct a newContextConfigurationAttributesinstance for the test class that declared the@ContextConfigurationannotation and its corresponding attributes.- 参数:
declaringClass- the test class that declared@ContextConfigurationlocations- the resource locations declared via@ContextConfigurationclasses- the annotated classes declared via@ContextConfigurationinheritLocations- theinheritLocationsflag declared via@ContextConfigurationinitializers- the context initializers declared via@ContextConfigurationinheritInitializers- theinheritInitializersflag declared via@ContextConfigurationname- the name of level in the context hierarchy, ornullif not applicablecontextLoaderClass- theContextLoaderclass declared via@ContextConfiguration- 抛出:
IllegalArgumentException- if thedeclaringClassorcontextLoaderClassisnull
-
-
方法详细资料
-
getDeclaringClass
Get the class that declared the@ContextConfigurationannotation, either explicitly or implicitly.- 返回:
- the declaring class (never
null)
-
setClasses
Set the processed annotated classes, effectively overriding the original value declared via@ContextConfiguration.- 另请参阅:
-
getClasses
Get the annotated classes that were declared via@ContextConfiguration.Note: this is a mutable property. The returned value may therefore represent a processed value that does not match the original value declared via
@ContextConfiguration.- 返回:
- the annotated classes (potentially {empty)
- 另请参阅:
-
hasClasses
public boolean hasClasses()Determine if thisContextConfigurationAttributesinstance has class-based resources.- 返回:
trueif theclassesarray is not empty- 另请参阅:
-
setLocations
Set the processed resource locations, effectively overriding the original value declared via@ContextConfiguration.- 另请参阅:
-
getLocations
Get the resource locations that were declared via@ContextConfiguration.Note: this is a mutable property. The returned value may therefore represent a processed value that does not match the original value declared via
@ContextConfiguration.- 返回:
- the resource locations (potentially empty)
- 另请参阅:
-
hasLocations
public boolean hasLocations()Determine if thisContextConfigurationAttributesinstance has path-based resource locations.- 返回:
trueif thelocationsarray is not empty- 另请参阅:
-
hasResources
public boolean hasResources()Determine if thisContextConfigurationAttributesinstance has either path-based resource locations or class-based resources. -
isInheritLocations
public boolean isInheritLocations()Get theinheritLocationsflag that was declared via@ContextConfiguration.- 返回:
- the
inheritLocationsflag - 另请参阅:
-
getInitializers
Get theApplicationContextInitializerclasses that were declared via@ContextConfiguration.- 返回:
- the
ApplicationContextInitializerclasses
-
isInheritInitializers
public boolean isInheritInitializers()Get theinheritInitializersflag that was declared via@ContextConfiguration.- 返回:
- the
inheritInitializersflag
-
getName
Get the name of the context hierarchy level that was declared via@ContextConfiguration.- 返回:
- the name of the context hierarchy level or
nullif not applicable - 另请参阅:
-
getContextLoaderClass
Get theContextLoaderclass that was declared via@ContextConfiguration.- 返回:
- the
ContextLoaderclass - 另请参阅:
-
equals
Determine if the supplied object is equal to thisContextConfigurationAttributesinstance by comparing both object's declaring class, locations, annotated classes, inheritLocations flag, context initializer classes, inheritInitializers flag, and theContextLoader class. -
hashCode
public int hashCode()Generate a unique hash code for all properties of thisContextConfigurationAttributesinstance excluding the name. -
toString
Provide a String representation of the context configuration attributes and declaring class.
-