Interface DeterminableImports
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@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.- Since:
- 1.5.0
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Object>
determineImports(org.springframework.core.type.AnnotationMetadata metadata)
Return a set of objects that represent the imports.
Method Detail
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.- Parameters:
metadata
- the source meta-data- Returns:
- a key representing the annotations that actually drive the import