public class ClassUtils extends Object
限定符和类型 | 方法和说明 |
---|---|
static <T> List<Class<? extends T>> |
getAllClassByInterface(Class<T> c,
Context context,
String packageName)
获取接口的所有实现类
|
static List<Class<?>> |
getAllClassByPackage(String packageName,
Context context)
获取包内所有类
|
static List<Class<?>> |
getAllClassFromDexFile(Context context,
String packageName)
获取dexFile所有类
|
static List<String> |
getAllClassNameFromDexFile(Context context,
String packageName)
获取dexFile所有类
|
static Class |
loadClass(Context context,
String className)
加载类
|
public static Class loadClass(Context context, String className)
context
- className
- public static <T> List<Class<? extends T>> getAllClassByInterface(Class<T> c, Context context, String packageName)
c
- context
- packageName
- public static List<Class<?>> getAllClassByPackage(String packageName, Context context)
packageName
- context
- public static List<String> getAllClassNameFromDexFile(Context context, String packageName)
context
-