Class ClasspathScanner

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

public class ClasspathScanner extends AbstractGenerator
Provides FileTrees with classes from a given classpath.
  • Constructor Details

    • ClasspathScanner

      public ClasspathScanner(Project project)
      Instantiates a new classpath provider. The path needs to be set with path.
      Parameters:
      project - the project
  • Method Details

    • path

      public ClasspathScanner path(String path)
      Sets the path. The path is a list of directories or jar files separated by the system's path separator. Relative paths are resolved against the project's directory.
      Parameters:
      path - the path
      Returns:
      the classpath scanner
    • doProvide

      protected <T extends Resource> Stream<T> doProvide(ResourceRequest<T> requested)
      Provide FileTrees with classes from a given classpath if the requested resource is of type ClasspathElement.
      Specified by:
      doProvide in class AbstractProvider
      Type Parameters:
      T - the requested type
      Parameters:
      requested - the requested resources
      Returns:
      the stream