forked from JavaTX/JavaCompilerCore
PackageCrawler latest version
This commit is contained in:
parent
42010c5859
commit
dad08cfa46
@ -12,7 +12,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import java.lang.InterruptedException;
|
||||
/**
|
||||
* Hilft beim Durchsuchen von Packages
|
||||
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
|
||||
@ -22,8 +22,9 @@ public class PackageCrawler {
|
||||
|
||||
public static Set<Class<?>> getClassesInPackage(String packageName){
|
||||
List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
|
||||
classLoadersList.add(ClasspathHelper.contextClassLoader());
|
||||
classLoadersList.add(Thread.currentThread().getContextClassLoader());
|
||||
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
||||
classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent());
|
||||
|
||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
||||
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
|
||||
|
Loading…
Reference in New Issue
Block a user