Package io.micronaut.ast.groovy.scan
Class ClassPathAnnotationScanner
java.lang.Object
io.micronaut.ast.groovy.scan.ClassPathAnnotationScanner
- All Implemented Interfaces:
io.micronaut.core.io.scan.AnnotationScanner
@Internal
public class ClassPathAnnotationScanner
extends Object
implements io.micronaut.core.io.scan.AnnotationScanner
An optimized classpath scanner that includes the ability to optionally scan JAR files.
The implementation avoids loading the classes themselves by parsing the class definitions and reading only the annotations.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassPathAnnotationScannerincludeJars(boolean includeJars) Whether to include JAR files.Scan the given packages.protected voidprotected voidtraverseFile(String annotation, List<Class<?>> classes, Path filePath) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.io.scan.AnnotationScanner
scan, scan, scan, scan, scan, scan, scan, scan
-
Constructor Details
-
ClassPathAnnotationScanner
- Parameters:
classLoader- The class loader
-
ClassPathAnnotationScanner
public ClassPathAnnotationScanner()Default constructor.
-
-
Method Details
-
includeJars
Whether to include JAR files.- Parameters:
includeJars- The jar files to include- Returns:
- This scanner
-
scan
Scan the given packages.- Specified by:
scanin interfaceio.micronaut.core.io.scan.AnnotationScanner- Parameters:
annotation- The annotation to scan forpkg- The package to scan- Returns:
- A stream of classes
-
doScan
- Parameters:
annotation- The annotationpkg- The package- Returns:
- The list of class
-
traverseFile
- Parameters:
annotation- The annotationclasses- The classesfilePath- The filePath
-
scanFile
- Parameters:
annotation- The annotationfilePath- The file pathclasses- The classes
-