Class ClassScanner


  • public class ClassScanner
    extends java.lang.Object
    A utility for scanning classes in the classpath with some criteria.
    Author:
    Fabrizio Giudici
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassScanner()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<java.lang.Class<?>> findClasses()
      Scans for classes and returns them.
      ClassScanner withAnnotationFilter​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
      Adds a filter for an annotation.
      ClassScanner withIncludeFilter​(org.springframework.core.type.filter.TypeFilter filter)
      Adds an "include" filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassScanner

        public ClassScanner()
    • Method Detail

      • findClasses

        @Nonnull
        public final java.util.Collection<java.lang.Class<?>> findClasses()
        Scans for classes and returns them.
        Returns:
        the collection of scanned classes
      • withIncludeFilter

        @Nonnull
        public ClassScanner withIncludeFilter​(@Nonnull
                                              org.springframework.core.type.filter.TypeFilter filter)
        Adds an "include" filter.
        Parameters:
        filter - the filter
        Returns:
        itself for method chaining
      • withAnnotationFilter

        @Nonnull
        public ClassScanner withAnnotationFilter​(@Nonnull
                                                 java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
        Adds a filter for an annotation.
        Parameters:
        annotationClass - the annotation class
        Returns:
        itself for method chaining