Package: grails.boot.config.tools

## [Groovy] Class ClassPathScanner

- grails.boot.config.tools.ClassPathScanner

- 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

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected java.util.List` | `ignoredRootPackages()` @return 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 = { String annotation -> annotation.startsWith('grails.')` 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 = { String annotation -> annotation.startsWith('grails.')` 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 = { String annotation -> annotation.startsWith('grails.')` Scans for classes in the given package names

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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()`

- - ### 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 = { String annotation -> annotation.startsWith('grails.')

      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 = { String annotation -> annotation.startsWith('grails.')

      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 = { String annotation -> annotation.startsWith('grails.')

      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