public class AsmReflexUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
findGetterMethodIndex(Class<?> targetClass,
String fieldName)
从指定类及其父类中寻找指定属性的getter方法的访问下标:
优先寻找格式为“getFieldName”,并且没有参数的方法;
若找不到,再寻找格式为“isFieldName”,并且没有参数的方法;
仍然找不到,再寻找格式为“fieldName”,并且没有参数的方法;
|
static MethodInvoker |
findMethod(Class<?> targetClass,
Method method)
获取指定方法
|
static MethodInvoker |
findMethod(Class<?> targetClass,
Method method,
boolean enableParamTypeConvert)
获取指定方法
|
static int |
findSetterMethodIndex(Class<?> targetClass,
String fieldName,
Class<?> fieldType)
从指定类及其父类中寻找指定属性的setter方法的访问下标
优先寻找格式为“setFieldName”,并且有且仅有一个类型为fieldType的方法;
若找不到,再寻找格式为“fieldName”,并且有且仅有一个类型为fieldType的方法;
|
static com.esotericsoftware.reflectasm.MethodAccess |
getMethodAccess(Class<?> targetClass)
获取
MethodAccess |
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 MethodInvoker findMethod(Class<?> targetClass, Method method, boolean enableParamTypeConvert)
targetClass - 目标类型method - 目标方法enableParamTypeConvert - 是否允许自动转换入参类型public static MethodInvoker findMethod(Class<?> targetClass, Method method)
targetClass - 目标类型method - 目标方法Copyright © 2022. All rights reserved.