PackageCrawler: Convert class names to list of strings.

This commit is contained in:
Jakob Herrmann 2017-02-22 00:04:16 +01:00
parent 72bf03ec58
commit 15f8a1b99d

View File

@ -9,6 +9,7 @@ import org.reflections.util.FilterBuilder;
import java.util.LinkedList;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
/**
@ -32,4 +33,13 @@ public class PackageCrawler {
return classes;
}
public static List<String> getClassNames(String packageName){
List<String> nameList = new ArrayList();
Set<Class<?>> classes = getClassesInPackage(packageName);
for(Class c : classes){
nameList.add(c.getName());
}
return nameList;
}
}