Class ClassFinder<T>


  • public final class ClassFinder<T>
    extends Object
    The helper class to find sub types of a given super class.
    • Method Detail

      • byURL

        public ClassFinder<T> byURL​(String pattern)
        Find with the given URL pattern.
        Parameters:
        pattern - the URL pattern
        Returns:
        the same finder
      • within

        public ClassFinder<T> within​(String packageName)
        Only search within the given package name.
        Parameters:
        packageName - the package name
        Returns:
        same class finder instance
      • using

        public ClassFinder<?> using​(ClassLoader loader)
        Search using the given class loader.
        Parameters:
        loader - the class loader
        Returns:
        the class finder instance
      • having

        public ClassFinder<T> having​(Class<? extends Annotation> annotation)
        Only search classes with the given annotation.
        Parameters:
        annotation - the annotation to check
        Returns:
        same class finder instance
      • any

        public ClassFinder<T> any()
        In case of multiple having(Class) calls, whether to check any one annotation (by default all annotations are checked).
        Returns:
        same class finder instance
      • find

        public Set<Class<? extends T>> find()
        Find the classes.
        Returns:
        set of matched classes