Class ComponentClassPathScanner

java.lang.Object
com.bobocode.bring.core.context.scaner.impl.ComponentClassPathScanner
All Implemented Interfaces:
ClassPathScanner

public class ComponentClassPathScanner extends Object implements 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 Details

    • reflections

      private final org.reflections.Reflections reflections
      The Reflections instance used for scanning classes.
  • Constructor Details

    • ComponentClassPathScanner

      public ComponentClassPathScanner()
  • Method Details

    • scan

      public Set<Class<?>> scan()
      Scans the classpath to retrieve classes annotated with @Component.
      Specified by:
      scan in interface ClassPathScanner
      Returns:
      a set of classes annotated with @Component
    • getAnnotation

      public Class<? extends Annotation> getAnnotation()
      Retrieves the annotation type scanned by this class path scanner.
      Specified by:
      getAnnotation in interface ClassPathScanner
      Returns:
      The Class object representing the annotation scanned by this class path scanner.