Interface PackageScanFilter

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface PackageScanFilter
Predicate applied by PackageScanClassResolver during classpath scanning to determine whether a discovered class should be included in the result set.

Implementations receive each candidate class and return true to include it or false to skip it. Because this is a FunctionalInterface, a filter can be expressed as a lambda or method reference:

resolver.findByFilter(cls -> cls.isAnnotationPresent(MyAnnotation.class), "com.example");
Global filters registered via PackageScanClassResolver.addFilter(PackageScanFilter) apply to every subsequent scan; per-query filters passed to PackageScanClassResolver.findByFilter(PackageScanFilter, String...) apply only to that single call.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches(Class<?> type)
    Does the given class match
  • Method Details

    • matches

      boolean matches(Class<?> type)
      Does the given class match
      Parameters:
      type - the class
      Returns:
      true to include this class, false to skip it.