String relativedName = className.substring(className.lastIndexOf('.') + 1, className.length());
String patName = relativedName.replace("*", "(\\w+)");
Pattern pat = Pattern.compile(patName);
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
JavaFileManager fm = compiler.getStandardFileManager(
new DiagnosticCollector<JavaFileObject>(), null, null);
HashSet<JavaFileObject.Kind> kind = new HashSet<JavaFileObject.Kind>(){{
add(JavaFileObject.Kind.CLASS);
}};
for (JavaFileObject f : fm.list(StandardLocation.PLATFORM_CLASS_PATH, packageName, kind, false)) {
String relatived0 = f.getName();
String name0 = relatived0.substring(0, relatived0.length() - ".class".length());
Matcher m = pat.matcher(name0);
if (m.matches()) {
String name = packageName + '.' + name0;