Class DefaultClasspathScanner

java.lang.Object
org.junit.platform.commons.support.scanning.DefaultClasspathScanner
All Implemented Interfaces:
ClasspathScanner

@API(status=INTERNAL, since="1.12") public class DefaultClasspathScanner extends Object implements ClasspathScanner

DISCLAIMER

These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!

Since:
1.0
  • Constructor Details

  • Method Details

    • scanForClassesInPackage

      public List<Class<?>> scanForClassesInPackage(String basePackageName, ClassFilter classFilter)
      Description copied from interface: ClasspathScanner
      Find all classes in the supplied classpath root that match the specified classFilter filter.

      The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

      Specified by:
      scanForClassesInPackage in interface ClasspathScanner
      Parameters:
      basePackageName - the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
      classFilter - the class type filter; never null
      Returns:
      a list of all such classes found; never null but potentially empty
    • scanForClassesInClasspathRoot

      public List<Class<?>> scanForClassesInClasspathRoot(URI root, ClassFilter classFilter)
      Description copied from interface: ClasspathScanner
      Find all classes in the supplied classpath root that match the specified classFilter filter.

      The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

      Specified by:
      scanForClassesInClasspathRoot in interface ClasspathScanner
      Parameters:
      root - the URI for the classpath root in which to scan; never null
      classFilter - the class type filter; never null
      Returns:
      a list of all such classes found; never null but potentially empty
    • scanForResourcesInPackage

      public List<Resource> scanForResourcesInPackage(String basePackageName, Predicate<Resource> resourceFilter)
      Description copied from interface: ClasspathScanner
      Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

      The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

      Specified by:
      scanForResourcesInPackage in interface ClasspathScanner
      Parameters:
      basePackageName - the name of the base package in which to start scanning; must not be null and must be valid in terms of Java syntax
      resourceFilter - the resource type filter; never null
      Returns:
      a list of all such resources found; never null but potentially empty
    • scanForResourcesInClasspathRoot

      public List<Resource> scanForResourcesInClasspathRoot(URI root, Predicate<Resource> resourceFilter)
      Description copied from interface: ClasspathScanner
      Find all resources in the supplied classpath root that match the specified resourceFilter predicate.

      The classpath scanning algorithm searches recursively in subpackages beginning with the root of the classpath.

      Specified by:
      scanForResourcesInClasspathRoot in interface ClasspathScanner
      Parameters:
      root - the URI for the classpath root in which to scan; never null
      resourceFilter - the resource type filter; never null
      Returns:
      a list of all such resources found; never null but potentially empty