Package: grails.boot.config.tools

## [Groovy] Class ClassPathScanner

- grails.boot.config.tools.ClassPathScanner

-     @groovy.util.logging.Slf4j
      @groovy.transform.CompileStatic
      class ClassPathScanner
      extends java.lang.Object

  Used to scan for classes on the classpath in the most efficient manner possible. WARNING: Classpath scanning can be expensive! Use with care.

  Authors:
    Graeme Rocher
  Since:
    3.1.12

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `private static class` | `ClassPathScanner.ApplicationRelativeClassLoader` |
    `private static class` | `ClassPathScanner.GrailsClasspathIgnoringResourceResolver` |

  - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.util.List` | `DEFAULT_IGNORED_ROOT_PACKAGES` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `ClassPathScanner ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected java.util.List` | `ignoredRootPackages()` Returns: The root packages to ignore by default
    `` | `protected boolean` | `isExcluded(org.springframework.core.io.Resource res)` Whether the given resource is excluded
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.Class applicationClass)` Scans for classes relative to the given class
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.Class applicationClass, java.lang.Class<? extends java.lang.annotation.Annotation> annotationFilter)` Scans for classes relative to the given class
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.Class applicationClass, groovy.lang.Closure<java.lang.Boolean> annotationFilter)` Scans for classes relative to the given class
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.Class applicationClass, java.util.Collection<java.lang.String> packageNames, java.lang.Class<? extends java.lang.annotation.Annotation> annotationFilter)` Scans for classes relative to the given class
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.Class applicationClass, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)` Scans for classes relative to the given class
    `` | `java.util.Set<java.lang.Class>` | `scan(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)` Scans for classes in the given package names
    `` | `java.util.Set<java.lang.Class>` | `scan(java.lang.ClassLoader classLoader, org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)` Scans for classes in the given package names
    `` | `private void` | `scanUsingPattern(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.lang.String pattern, java.lang.ClassLoader classLoader, groovy.lang.Closure<java.lang.Boolean> annotationFilter, java.util.Set<java.lang.Class> classes)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private static final java.util.List DEFAULT_IGNORED_ROOT_PACKAGES

  - ### Constructor Detail

    - #### ClassPathScanner()

  - ### Method Detail

    - #### protected java.util.List ignoredRootPackages()

      Returns:
        The root packages to ignore by default

    - #### protected boolean isExcluded(org.springframework.core.io.Resource res)

      Whether the given resource is excluded

      Parameters:
        `res` - The resource
      Returns:
        True if it should be excluded

    - #### java.util.Set<java.lang.Class> scan(java.lang.Class applicationClass)

      Scans for classes relative to the given class

      Parameters:
        `applicationClass` - The class, usually the Application class
      Returns:
        A set of classes

    - #### java.util.Set<java.lang.Class> scan(java.lang.Class applicationClass, java.lang.Class<? extends java.lang.annotation.Annotation> annotationFilter)

      Scans for classes relative to the given class

      Parameters:
        `applicationClass` - The class, usually the Application class
        `annotationFilter` - The annotation to filter by
      Returns:
        A set of classes

    - #### java.util.Set<java.lang.Class> scan(java.lang.Class applicationClass, groovy.lang.Closure<java.lang.Boolean> annotationFilter)

      Scans for classes relative to the given class

      Parameters:
        `applicationClass` - The class, usually the Application class
        `annotationFilter` - The annotation to filter by
      Returns:
        A set of classes

    - #### java.util.Set<java.lang.Class> scan(java.lang.Class applicationClass, java.util.Collection<java.lang.String> packageNames, java.lang.Class<? extends java.lang.annotation.Annotation> annotationFilter)

      Scans for classes relative to the given class

      Parameters:
        `applicationClass` - The class, usually the Application class
        `packageNames` - The package names to scan
        `annotationFilter` - The annotation to filter by
      Returns:
        A set of classes

    - #### java.util.Set<java.lang.Class> scan(java.lang.Class applicationClass, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)

      Scans for classes relative to the given class

      Parameters:
        `applicationClass` - The class, usually the Application class
        `packageNames` - The package names to scan
      Returns:
        A set of classes

    - #### java.util.Set<java.lang.Class> scan(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)

      Scans for classes in the given package names

      Parameters:
        `resourcePatternResolver` - The resolver to use
        `packageNames` - The package names
      Returns:
        The found classes

    - #### java.util.Set<java.lang.Class> scan(java.lang.ClassLoader classLoader, org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.util.Collection<java.lang.String> packageNames, groovy.lang.Closure<java.lang.Boolean> annotationFilter)

      Scans for classes in the given package names

      Parameters:
        `classLoader` - The classloader to use to load classes
        `resourcePatternResolver` - The resolver
        `packageNames` - The package names
        `annotationFilter` - The filter
      Returns:
        The classes

    - #### private void scanUsingPattern(org.springframework.core.io.support.ResourcePatternResolver resourcePatternResolver, java.lang.String pattern, java.lang.ClassLoader classLoader, groovy.lang.Closure<java.lang.Boolean> annotationFilter, java.util.Set<java.lang.Class> classes)