Class ClasspathScanner
java.lang.Object
cz.cvut.kbss.jsonld.deserialization.util.ClasspathScanner
Processes classpath accessible to the application and passes all discovered classes to the registered listener.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessClasses(ClassLoader loader, String scanPath) Scans classpath accessible from the current thread's class loader.voidprocessClasses(String scanPath) Scans classpath accessible from the current thread's class loader.protected voidprocessJarFile(ClassLoader loader, URL jarResource, String packageName)
-
Constructor Details
-
ClasspathScanner
-
-
Method Details
-
processClasses
Scans classpath accessible from the current thread's class loader. -
processClasses
Scans classpath accessible from the current thread's class loader.All available classes are passed to the registered consumer.
The
loaderparameter is the loader that should be used to scan the classpath.The
scanPathparameter means that only the specified package (and it subpackages) should be searched. This parameter is optional, but it is highly recommended to specify it, as it can speed up the process dramatically.Inspired by https://github.com/ddopson/java-class-enumerator
- Parameters:
scanPath- Package narrowing down the scan space. Optional
-
processJarFile
-