Class Scanner

  • All Implemented Interfaces:
    io.avaje.classpath.scanner.ClassPathScanner

    public class Scanner
    extends Object
    implements io.avaje.classpath.scanner.ClassPathScanner
    Scanner for Resources and Classes.
    • Method Detail

      • scanForResources

        public List<io.avaje.classpath.scanner.Resource> scanForResources​(Location location,
                                                                          io.avaje.classpath.scanner.ResourceFilter predicate)
        Scans this location for resources matching the given predicate.

        The location can have a prefix of filesystem: or classpath: to determine how to scan. If no prefix is used then classpath scan is the default.

        Parameters:
        location - The location to start searching. Subdirectories are also searched.
        predicate - The predicate used to match resource names.
        Returns:
        The resources that were found.
      • scanForResources

        public List<io.avaje.classpath.scanner.Resource> scanForResources​(String location,
                                                                          io.avaje.classpath.scanner.ResourceFilter predicate)
        Scans this location for resources matching the given predicate.

        The location can have a prefix of filesystem: or classpath: to determine how to scan. If no prefix is used then classpath scan is the default.

        Specified by:
        scanForResources in interface io.avaje.classpath.scanner.ClassPathScanner
        Parameters:
        location - The location to start searching. Subdirectories are also searched.
        predicate - The predicate used to match resource names.
        Returns:
        The resources that were found.
      • scanForClasses

        public List<Class<?>> scanForClasses​(Location location,
                                             io.avaje.classpath.scanner.ClassFilter predicate)
        Scans the classpath for classes under the specified package matching the given predicate.
        Parameters:
        location - The package in the classpath to start scanning. Subpackages are also scanned.
        predicate - The predicate used to match scanned classes.
        Returns:
        The classes found matching the predicate
      • scanForClasses

        public List<Class<?>> scanForClasses​(String location,
                                             io.avaje.classpath.scanner.ClassFilter predicate)
        Scans the classpath for classes under the specified package matching the given predicate.
        Specified by:
        scanForClasses in interface io.avaje.classpath.scanner.ClassPathScanner
        Parameters:
        location - The package in the classpath to start scanning. Subpackages are also scanned.
        predicate - The predicate used to match scanned classes.
        Returns:
        The classes found matching the predicate