common_helper/src/main/java/com/xiongyingqi/util/ClassHelper.java
public static Class[] getAllClasses() {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Class<?> cla = classLoader.getClass();
        while (cla != ClassLoader.class)
            cla = cla.getSuperclass();
        Field field = null;
        try {
            field = cla.getDeclaredField("classes");
            field.setAccessible(true);
            Vector<Class> v = null;
            try {
                v = (Vector<Class>) field.get(classLoader);
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < v.size(); i++) {
                System.out.println(v.get(i));
            }
            return v.toArray(new Class[]{});
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }
        return null;
    }
public static Class[] getAllClasses() {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        Class<?> cla = classLoader.getClass();
        while (cla != ClassLoader.class)
            cla = cla.getSuperclass();
        Field field = null;
        try {
            field = cla.getDeclaredField("classes");
            field.setAccessible(true);
            Vector<Class> v = null;
            try {
                v = (Vector<Class>) field.get(classLoader);
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < v.size(); i++) {
                System.out.println(v.get(i));
            }
            return v.toArray(new Class[]{});
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        }
        return null;
    }
public static Class [ ] getAllClasses ( ) { ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; Class < ? > cla = classLoader . getClass ( ) ; while ( cla != ClassLoader . class ) cla = cla . getSuperclass ( ) ; Field field = null ; try { field = cla . getDeclaredField ( "classes" ) ; field . setAccessible ( true ) ; Vector < Class > v = null ; try { v = ( Vector < Class > ) field . get ( classLoader ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } for ( int i = 0 ; i < v . size ( ) ; i ++ ) { System . out . println ( v . get ( i ) ) ; } return v . toArray ( new Class [ ] { } ) ; } catch ( NoSuchFieldException e ) { e . printStackTrace ( ) ; } return null ; }
获取加载的所有类

@return
获取加载的所有类