本文整理了Java中org.jgroups.util.Util.recurse()
方法的一些代码示例,展示了Util.recurse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.recurse()
方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:recurse
暂无
代码示例来源:origin: wildfly/wildfly
public static List<Class<?>> findClassesAnnotatedWith(String packageName,Class<? extends Annotation> a) throws IOException, ClassNotFoundException {
List<Class<?>> classes=new ArrayList<>();
recurse(classes,packageName,a);
return classes;
}
代码示例来源:origin: wildfly/wildfly
private static void recurse(List<Class<?>> classes,String packageName,Class<? extends Annotation> a) throws ClassNotFoundException {
ClassLoader loader=Thread.currentThread().getContextClassLoader();
String path=packageName.replace('.','/');
URL resource=loader.getResource(path);
if(resource != null) {
String filePath=resource.getFile();
if(filePath != null && new File(filePath).isDirectory()) {
for(String file : new File(filePath).list()) {
if(file.endsWith(".class")) {
String name=packageName + '.' + file.substring(0,file.indexOf(".class"));
Class<?> clazz=Class.forName(name);
if(clazz.isAnnotationPresent(a))
classes.add(clazz);
}
else if(new File(filePath,file).isDirectory()) {
recurse(classes,packageName + "." + file,a);
}
}
}
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
public static List<Class<?>> findClassesAnnotatedWith(String packageName,Class<? extends Annotation> a) throws IOException, ClassNotFoundException {
List<Class<?>> classes=new ArrayList<>();
recurse(classes,packageName,a);
return classes;
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
private static void recurse(List<Class<?>> classes,String packageName,Class<? extends Annotation> a) throws ClassNotFoundException {
ClassLoader loader=Thread.currentThread().getContextClassLoader();
String path=packageName.replace('.','/');
URL resource=loader.getResource(path);
if(resource != null) {
String filePath=resource.getFile();
if(filePath != null && new File(filePath).isDirectory()) {
for(String file : new File(filePath).list()) {
if(file.endsWith(".class")) {
String name=packageName + '.' + file.substring(0,file.indexOf(".class"));
Class<?> clazz=Class.forName(name);
if(clazz.isAnnotationPresent(a))
classes.add(clazz);
}
else if(new File(filePath,file).isDirectory()) {
recurse(classes,packageName + "." + file,a);
}
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!