Interface ImportSelector
- All Known Subinterfaces:
DeferredImportSelector
- All Known Implementing Classes:
AdviceModeImportSelector,AsyncConfigurationSelector,CachingConfigurationSelector,TransactionManagementConfigurationSelector
public interface ImportSelector
Interface to be implemented by types that determine which @Configurationclass(es) should be imported based on a given selection criteria, usually one or more annotation attributes.An
ImportSelectormay implement any of the followingAwareinterfaces, and their respective methods will be called prior toselectImports(org.springframework.core.type.AnnotationMetadata):Alternatively, the class may provide a single constructor with one or more of the following supported parameter types:
ImportSelectorimplementations are usually processed in the same way as regular@Importannotations, however, it is also possible to defer selection of imports until all@Configurationclasses have been processed (seeDeferredImportSelectorfor details).- Since:
- 3.1
- Author:
- Chris Beams, Juergen Hoeller
- See Also:
DeferredImportSelector,Import,ImportBeanDefinitionRegistrar,Configuration
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Predicate<String>getExclusionFilter()Return a predicate for excluding classes from the import candidates, to be transitively applied to all classes found through this selector's imports.String[]selectImports(AnnotationMetadata importingClassMetadata)Select and return the names of which class(es) should be imported based on theAnnotationMetadataof the importing @Configurationclass.
Method Detail
selectImports
String[] selectImports(AnnotationMetadata importingClassMetadata)
Select and return the names of which class(es) should be imported based on theAnnotationMetadataof the importing @Configurationclass.- Returns:
- the class names, or an empty array if none
getExclusionFilter
@Nullable default Predicate<String> getExclusionFilter()
Return a predicate for excluding classes from the import candidates, to be transitively applied to all classes found through this selector's imports.If this predicate returns
truefor a given fully-qualified class name, said class will not be considered as an imported configuration class, bypassing class file loading as well as metadata introspection.- Returns:
- the filter predicate for fully-qualified candidate class names of transitively imported configuration classes, or
nullif none - Since:
- 5.2.4