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.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.lang.InterruptedException;
|
||||||
/**
|
/**
|
||||||
* Hilft beim Durchsuchen von Packages
|
* Hilft beim Durchsuchen von Packages
|
||||||
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
|
* Benutzt die Reflections-Library (https://github.com/ronmamo/reflections)
|
||||||
@ -20,10 +20,11 @@ import java.util.Set;
|
|||||||
*/
|
*/
|
||||||
public class PackageCrawler {
|
public class PackageCrawler {
|
||||||
|
|
||||||
public static Set<Class<?>> getClassesInPackage(String packageName) {
|
public static Set<Class<?>> getClassesInPackage(String packageName){
|
||||||
List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
|
List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
|
||||||
classLoadersList.add(ClasspathHelper.contextClassLoader());
|
classLoadersList.add(Thread.currentThread().getContextClassLoader());
|
||||||
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
||||||
|
classLoadersList.add(Thread.currentThread().getContextClassLoader().getParent());
|
||||||
|
|
||||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
||||||
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
|
.setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
|
||||||
|
Loading…
Reference in New Issue
Block a user