类 Configurations
- java.lang.Object
- org.springframework.boot.context.annotation.Configurations
- 直接已知子类:
UserConfigurations
public abstract class Configurations extends Object
A set of@Configuration
classes that can be registered inApplicationContext
. Classes can be returned from one or moreConfigurations
instances by usinggetClasses(Configurations[])
. The resulting array follows the ordering rules usually applied by theApplicationContext
and/or customImportSelector
implementations.This class is primarily intended for use with tests that need to specify configuration classes but can't use
SpringRunner
.Implementations of this class should be annotated with
@Order
or implementOrdered
.- 从以下版本开始:
- 2.0.0
- 另请参阅:
UserConfigurations
构造器概要
构造器 限定符 构造器 说明 protected
Configurations(Collection<Class<?>> classes)
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected Set<Class<?>>
getClasses()
static Class<?>[]
getClasses(Collection<Configurations> configurations)
Return the classes from all the specified configurations in the order that they would be registered.static Class<?>[]
getClasses(Configurations... configurations)
Return the classes from all the specified configurations in the order that they would be registered.protected abstract Configurations
merge(Set<Class<?>> mergedClasses)
Merge configurations.protected Configurations
merge(Configurations other)
Merge configurations from another source of the same type.protected Collection<Class<?>>
sort(Collection<Class<?>> classes)
Sort configuration classes into the order that they should be applied.
构造器详细资料
Configurations
protected Configurations(Collection<Class<?>> classes)
方法详细资料
sort
protected Collection<Class<?>> sort(Collection<Class<?>> classes)
Sort configuration classes into the order that they should be applied.- 参数:
classes
- the classes to sort- 返回:
- a sorted set of classes
getClasses
protected final Set<Class<?>> getClasses()
merge
protected Configurations merge(Configurations other)
Merge configurations from another source of the same type.- 参数:
other
- the otherConfigurations
(must be of the same type as this instance)- 返回:
- a new configurations instance (must be of the same type as this instance)
merge
protected abstract Configurations merge(Set<Class<?>> mergedClasses)
Merge configurations.- 参数:
mergedClasses
- the merged classes- 返回:
- a new configurations instance (must be of the same type as this instance)
getClasses
public static Class<?>[] getClasses(Configurations... configurations)
Return the classes from all the specified configurations in the order that they would be registered.- 参数:
configurations
- the source configuration- 返回:
- configuration classes in registration order
getClasses
public static Class<?>[] getClasses(Collection<Configurations> configurations)
Return the classes from all the specified configurations in the order that they would be registered.- 参数:
configurations
- the source configuration- 返回:
- configuration classes in registration order