public class AnnotatedClassScanner extends ClassPathScanningCandidateComponentProvider
logger
Constructor and Description |
---|
AnnotatedClassScanner(boolean useDefaultFilters,
Environment environment,
Class<?>... annotationTypes)
Constructor.
|
AnnotatedClassScanner(Class<?>... annotationTypes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
registerDefaultFilters()
Register default include/exclude filters.
|
ArrayList<String> |
scanForClasses(String... basePackages)
Locate annotated classes on the classpath.
|
addExcludeFilter, addIncludeFilter, clearCache, findCandidateComponents, getEnvironment, getMetadataReaderFactory, getRegistry, getResourceLoader, isCandidateComponent, isCandidateComponent, resetFilters, resolveBasePackage, setEnvironment, setMetadataReaderFactory, setResourceLoader, setResourcePattern
public AnnotatedClassScanner(Class<?>... annotationTypes)
StandardEnvironment
.annotationTypes
- type annotations to search forIllegalArgumentException
- if annotationTypes
is null, empty, or contains any non-annotation typespublic AnnotatedClassScanner(boolean useDefaultFilters, Environment environment, Class<?>... annotationTypes)
useDefaultFilters
- whether to register the default filters for the specified annotationTypes
environment
- environment to useannotationTypes
- type annotations to search forIllegalArgumentException
- if annotationTypes
is null, empty, or contains any non-annotation typespublic ArrayList<String> scanForClasses(String... basePackages)
basePackages
- one or more base pacakge namesIllegalArgumentException
- if basePackages
is emptyprotected void registerDefaultFilters()
Overridden in AnnotatedClassScanner
to set the default filters to be ones that match classes
annotated with any of the annotation types provided to the constructor.
registerDefaultFilters
in class ClassPathScanningCandidateComponentProvider
Copyright © 2022. All rights reserved.