接口 DeterminableImports
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface DeterminableImports
Interface that can be implemented byImportSelector
andImportBeanDefinitionRegistrar
implementations when they can determine imports early. TheImportSelector
andImportBeanDefinitionRegistrar
interfaces are quite flexible which can make it hard to tell exactly what bean definitions they will add. This interface should be used when an implementation consistently results in the same imports, given the same source.Using
DeterminableImports
is particularly useful when working with Spring's testing support. It allows for better generation ofApplicationContext
cache keys.- 从以下版本开始:
- 1.5.0
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 Set<Object>
determineImports(org.springframework.core.type.AnnotationMetadata metadata)
Return a set of objects that represent the imports.
方法详细资料
determineImports
Set<Object> determineImports(org.springframework.core.type.AnnotationMetadata metadata)
Return a set of objects that represent the imports. Objects within the returnedSet
must implement a validhashCode
andequals
.Imports from multiple
DeterminableImports
instances may be combined by the caller to create a complete set.Unlike
ImportSelector
andImportBeanDefinitionRegistrar
anyAware
callbacks will not be invoked before this method is called.- 参数:
metadata
- the source meta-data- 返回:
- a key representing the annotations that actually drive the import