Package org.springframework.data.util
Interface TypeScanner
public interface TypeScanner
A scanner that searches the classpath for matching types within given target packages.
- Since:
- 3.0
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionObtain the scan result.voidPerforms the given action for each element found while scanning.default TypeScannerforTypesAnnotatedWith(Class<? extends Annotation>... annotations) Define annotations identifying types to include in the scan result.forTypesAnnotatedWith(Collection<Class<? extends Annotation>> annotations) Define annotations identifying types to include in the scan result.Define what happens in the case of aClassNotFoundException.default TypeScannerscanPackages(String... packageNames) Collects thenamesof packages to scan.scanPackages(Collection<String> packageNames) Collects thenamesof packages to scan.static TypeScannertypeScanner(ClassLoader classLoader) Create a newTypeScannerusing the givenClassLoader.static TypeScannertypeScanner(ApplicationContext context) Create a newTypeScannerusing the givenApplicationContext.static TypeScannertypeScanner(ResourceLoader resourceLoader) Create a newTypeScannerusing the givenResourceLoader.
-
Method Details
-
typeScanner
Create a newTypeScannerusing the givenClassLoader.- Parameters:
classLoader- must not be null.- Returns:
- new instance of
TypeScanner.
-
typeScanner
Create a newTypeScannerusing the givenResourceLoader.- Parameters:
resourceLoader- must not be null.- Returns:
- new instance of
TypeScanner.
-
typeScanner
Create a newTypeScannerusing the givenApplicationContext.- Parameters:
context- must not be null.- Returns:
- new instance of
TypeScanner.
-
scanPackages
Collects thenamesof packages to scan.- Parameters:
packageNames- array ofpackage namesto scan; Must not be null.- Returns:
- new instance of
TypeScanner. - See Also:
-
scanPackages
Collects thenamesof packages to scan.- Parameters:
packageNames-Collectionofpackage namesto scan.- Returns:
- new instance of
TypeScanner. - See Also:
-
forTypesAnnotatedWith
Define annotations identifying types to include in the scan result.- Parameters:
annotations- must not be null.- Returns:
- new instance of
TypeScanner. - See Also:
-
forTypesAnnotatedWith
Define annotations identifying types to include in the scan result.- Parameters:
annotations- must not be null.- Returns:
- new instance of
TypeScanner.
-
onClassNotFound
Define what happens in the case of aClassNotFoundException.- Parameters:
action- must not be null.- Returns:
-
collectAsSet
Obtain the scan result.- Returns:
- never null.
-
forEach
Performs the given action for each element found while scanning.- Parameters:
action- must not be null.
-