Object ClassPathScanner

  • All Implemented Interfaces:

    
    public class ClassPathScanner
    
                        

    An utility class providing support for loading arbitrary subclasses available in the classpath.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> List<Class<out T>> subTypesOf(Class<T> superClass, String inPackage) This function loads all subtypes of the provided Java class that can be discovered on the current classpath.
      final <T extends Any> List<Class<out T>> subTypesOf(String inPackage) This function loads all subtypes of the provided Java class that can be discovered on the current classpath.
      final static List<URL> resourcesMatching(String regex, String inPackage) This function returns a list of all the resources in a certain (optional) package matching a regular expression.
      final static List<InputStream> resourcesMatchingAsStream(String regex, String inPackage) This function returns a list of all the resources in a certain (optional) package matching a regular expression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • subTypesOf

         final static <T extends Any> List<Class<out T>> subTypesOf(Class<T> superClass, String inPackage)

        This function loads all subtypes of the provided Java class that can be discovered on the current classpath.

        This function cannot use reified and inline (as it should have) due to Java being unaware of the required transformation to use them.

      • subTypesOf

         final <T extends Any> List<Class<out T>> subTypesOf(String inPackage)

        This function loads all subtypes of the provided Java class that can be discovered on the current classpath.

      • resourcesMatching

         final static List<URL> resourcesMatching(String regex, String inPackage)

        This function returns a list of all the resources in a certain (optional) package matching a regular expression.

        This function cannot use reified and inline (as it should have) due to Java being unaware of the required transformation to use them.