public class AsmReflexUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
AsmReflexUtils.AsmReflexBeanProperty |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
findGetterMethodIndex(Class<?> targetClass,
String fieldName)
从指定类及其父类中寻找指定属性的getter方法的访问下标:
优先寻找格式为“getFieldName”,并且没有参数的方法;
若找不到,再寻找格式为“isFieldName”,并且没有参数的方法;
仍然找不到,再寻找格式为“fieldName”,并且没有参数的方法;
|
static IndexedMethod |
findMethod(Class<?> targetClass,
Method method)
获取指定方法
|
static IndexedMethod |
findMethod(Class<?> targetClass,
String methodName,
Class<?>... paramTypes)
获取指定方法
|
static Optional<BeanProperty> |
findProperty(Class<?> targetClass,
String fieldName)
获取字段缓存
|
static int |
findSetterMethodIndex(Class<?> targetClass,
String fieldName,
Class<?> fieldType)
从指定类及其父类中寻找指定属性的setter方法的访问下标
优先寻找格式为“setFieldName”,并且有且仅有一个类型为fieldType的方法;
若找不到,再寻找格式为“fieldName”,并且有且仅有一个类型为fieldType的方法;
|
static com.esotericsoftware.reflectasm.MethodAccess |
getMethodAccess(Class<?> targetClass)
获取
MethodAccess |
@Nonnull public static Optional<BeanProperty> findProperty(Class<?> targetClass, String fieldName)
targetClass - 类fieldName - 属性名IllegalArgumentException - 当属性存在,而却找不到对应setter与getter方法时抛出public static int findSetterMethodIndex(Class<?> targetClass, String fieldName, Class<?> fieldType)
targetClass - 属性fieldName - 属性名public static int findGetterMethodIndex(Class<?> targetClass, String fieldName)
targetClass - 类fieldName - 属性名public static com.esotericsoftware.reflectasm.MethodAccess getMethodAccess(Class<?> targetClass)
MethodAccesstargetClass - 目标类型public static IndexedMethod findMethod(Class<?> targetClass, String methodName, Class<?>... paramTypes)
targetClass - 目标类型methodName - 方法名称paramTypes - 方法参数类型public static IndexedMethod findMethod(Class<?> targetClass, Method method)
targetClass - 目标类型method - 目标方法Copyright © 2022. All rights reserved.