Class ComponentClassPathScanner
java.lang.Object
com.bobocode.bring.core.context.scaner.impl.ComponentClassPathScanner
- All Implemented Interfaces:
ClassPathScanner
Implementation of ClassPathScanner that scans for classes annotated with @Component using Reflections.
This scanner uses the Reflections library to scan the classpath and retrieve classes annotated with @Component.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.reflections.Reflections
The Reflections instance used for scanning classes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass
<? extends Annotation> Retrieves the annotation type scanned by this class path scanner.scan()
Scans the classpath to retrieve classes annotated with @Component.
-
Field Details
-
reflections
private final org.reflections.Reflections reflectionsThe Reflections instance used for scanning classes.
-
-
Constructor Details
-
ComponentClassPathScanner
public ComponentClassPathScanner()
-
-
Method Details
-
scan
Scans the classpath to retrieve classes annotated with @Component.- Specified by:
scan
in interfaceClassPathScanner
- Returns:
- a set of classes annotated with @Component
-
getAnnotation
Retrieves the annotation type scanned by this class path scanner.- Specified by:
getAnnotation
in interfaceClassPathScanner
- Returns:
- The Class object representing the annotation scanned by this class path scanner.
-