public class ClassUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
applyAllClass(Class<?> clazz,
Predicate<Class<?>> checkToContinue)
应用类及其除Object外的所有父类
|
static boolean |
canInstance(int mod) |
static List<Field> |
getAllFields(Class<?> clazz) |
static List<Field> |
getAllFields(Class<?> clazz,
Predicate<Field> predicate) |
static List<Method> |
getAllMethods(Class<?> clazz) |
static List<Method> |
getAllMethods(Class<?> clazz,
Predicate<Method> predicate) |
static Method |
getAnyMethod(Class<?> clazz,
String... methodNames) |
static Field |
getFirstField(Class<?> clazz,
Predicate<Field> predicate) |
static Method |
getFirstMethod(Class<?> clazz,
Predicate<Method> predicate) |
static Method |
getFirstMethodByAnnotation(Class<?> clazz,
Class<? extends Annotation> annotationClass) |
static <T> Class<T> |
getUsefulClass(Class<T> clazz) |
static Class<?> |
getWrapType(Class<?> clazz) |
static boolean |
isArray(Class<?> clazz) |
static boolean |
isGetterMethod(Method method,
String property) |
static boolean |
isObjectMethod(String methodName) |
static boolean |
isProxy(Class<?> clazz) |
static <T> T |
newInstance(Class<T> clazz) |
static <T> T |
newInstance(Class<T> clazz,
Object... paras) |
public static boolean isProxy(Class<?> clazz)
public static boolean isArray(Class<?> clazz)
public static boolean canInstance(int mod)
public static <T> T newInstance(Class<T> clazz)
public static void applyAllClass(Class<?> clazz, Predicate<Class<?>> checkToContinue)
clazz - 需要应用的类checkToContinue - 应用当前类并检测是否继续应用, 返回false则停止应用, 返回true继续向上取父类public static Method getFirstMethodByAnnotation(Class<?> clazz, Class<? extends Annotation> annotationClass)
public static boolean isObjectMethod(String methodName)
Copyright © 2024. All rights reserved.