Introduce alias for 'value' attribute in @ComponentScan.Filter

Issue: SPR-11393
This commit is contained in:
Sam Brannen
2015-06-04 15:25:20 -04:00
parent 384ee69300
commit ff8597fa80
3 changed files with 24 additions and 11 deletions

View File

@@ -296,11 +296,12 @@ class MyScopeMetadataResolver extends AnnotationScopeMetadataResolver {
}
@Configuration
@ComponentScan(basePackages="org.springframework.context.annotation",
@ComponentScan(
basePackages="org.springframework.context.annotation",
useDefaultFilters=false,
includeFilters=@Filter(type=FilterType.CUSTOM, value=ComponentScanParserTests.CustomTypeFilter.class),
includeFilters = @Filter(type = FilterType.CUSTOM, classes = ComponentScanParserTests.CustomTypeFilter.class),
// exclude this class from scanning since it's in the scanned package
excludeFilters=@Filter(type=FilterType.ASSIGNABLE_TYPE, value=ComponentScanWithCustomTypeFilter.class),
excludeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = ComponentScanWithCustomTypeFilter.class),
lazyInit = true)
class ComponentScanWithCustomTypeFilter {
@Bean
@@ -320,7 +321,7 @@ class ComponentScanWithCustomTypeFilter {
@ComponentScan(basePackages="example.scannable",
scopedProxy=ScopedProxyMode.INTERFACES,
useDefaultFilters=false,
includeFilters=@Filter(type=FilterType.ASSIGNABLE_TYPE, value=ScopedProxyTestBean.class))
includeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = ScopedProxyTestBean.class))
class ComponentScanWithScopedProxy {}
@Configuration