获取所有接口
import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Method;//来 自 时代Java import java.lang.reflect.Modifier; import java.net.URL; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.WeakHashMap; public class Main{ public static void main(String[] argv) throws Exception{ Class clazz = String.class; /* from N o w J a v a . c o m - 时代Java*/ System.out.println(getAllInterfaces(clazz)); } public static List<Class<?>> getAllInterfaces(Class<?> clazz) { if (clazz == null) { return null; } List<Class<?>> interfacesFound = CollectionUtil.createArrayList(); getAllInterfaces(clazz, interfacesFound); return interfacesFound; } private static void getAllInterfaces(Class<?> clazz, List<Class<?>> interfacesFound) { while (clazz != null) { Class<?>[] interfaces = clazz.getInterfaces(); for (