Object ClassPathScanner
-
- All Implemented Interfaces:
public class ClassPathScanner
An utility class providing support for loading arbitrary subclasses available in the classpath.
-
-
Field Summary
Fields Modifier and Type Field Description public final static ClassPathScanner
INSTANCE
-
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. -
-
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
andinline
(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
andinline
(as it should have) due to Java being unaware of the required transformation to use them.
-
resourcesMatchingAsStream
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.
-
-
-
-