}
addClass(clazz, classes, iface);
}
} else {
// Need to scan the classpath via ClassPath.from(loader)
ClassPath classPath;
try {
classPath = ClassPath.from(loader);
} catch (IOException e) {
continue;
}
for (String importSpec : importSpecs) {
Set<ClassInfo> classInfos = null;
if (importSpec.endsWith(".**")) {
String packageName = importSpec.substring(0, importSpec.length() - ".**".length());
classInfos = classPath.getTopLevelClassesRecursive(packageName);
} else if (importSpec.endsWith(".*")) {
String packageName = importSpec.substring(0, importSpec.length() - ".*".length());
classInfos = classPath.getTopLevelClasses(packageName);
} else { // importSpec is assumed to be a fully qualified class name
Class clazz;
try {
//clazz = Class.forName(importSpec, true, loader);
clazz = loader.loadClass(importSpec);