public class ServiceAccess extends Object
| 构造器和说明 |
|---|
ServiceAccess() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
createObject(String objectName)
根据类名初始化无参数实例
|
static Object |
execMethod(Object bean,
Method method)
根据类实例和方法名,执行方法
|
static Object |
getFieldValueInObjStr(Object bean,
List<Field> fieldName)
根据实例获取相应属性List的值和的字符串
|
static Method |
getObjMethod(Object bean,
String methodName,
Class<?> firstParamType,
Class<?> secondParamType)
根据类实例和方法名和方法的两个形参,获取方法
|
static Method |
getObjMethod(Object bean,
String methodName,
String firstParam,
String secondParam,
String thirdParam,
String fourthParam)
根据类实例和方法名和方法的四个形参,获取方法
|
static List<Object> |
getPrimaryFields(Object bean,
List<String> pkList)
根据属性名List获取所有主键值
|
static String |
getPrimaryFieldsStrViaList(List<String> pkList)
根据属性名List获取所有主键属性
|
static String |
getPrivateField(Object instance,
String filedName)
获取对象内的属性
|
static Class<?> |
reflectClazz(String objectName)
根据类名获取类字节码
|
static Field[] |
reflectDeclaredFields(Object bean)
根据实例获取所有属性
|
static Method[] |
reflectDeclaredMethod(Object bean)
根据类实例获取所有方法名
|
static Object |
reflectField(Object bean,
Field fieldName)
根据实例获取相应属性的值
|
static Object |
reflectField(Object bean,
String fieldPath)
根据实例和A|B|C格式路径反射相应属性的值
|
static Method |
reflectMethod(Class<?> clazz,
String methodName,
Class<?> firstParamType)
根据类实例和方法名和方法的一个形参,获取方法
|
static Method |
reflectMethod(Class<?> clazz,
String methodName,
Class<?> firstParamType,
Class<?> secondParamType)
根据类实例和方法名和方法的一个形参,获取方法
|
static Method |
reflectMethod(Class<?> clazz,
String methodName,
Class<?> firstParamType,
Class<?> secondParamType,
Class<?> thirdParamType)
根据类实例和方法名和方法的一个形参,获取方法
|
static Method |
reflectMethod(Class<?> clazz,
String methodName,
Class<?> firstParamType,
Class<?> secondParamType,
Class<?> thirdParamType,
Class<?> forthParamType)
根据类实例和方法名和方法的一个形参,获取方法
|
static Method |
reflectMethod(Object bean,
String methodName)
根据类实例和方法名,获取方法
|
public static Class<?> reflectClazz(String objectName) throws Exception
objectName - 反射类名Exceptionpublic static Object createObject(String objectName)
objectName - : 反射类名public static Method[] reflectDeclaredMethod(Object bean)
bean - : 类实例public static Method reflectMethod(Object bean, String methodName)
bean - : 类实例methodName - : 要反射的类方法public static Method reflectMethod(Class<?> clazz, String methodName, Class<?> firstParamType)
clazz - : 类methodName - : 要反射的类方法public static Method reflectMethod(Class<?> clazz, String methodName, Class<?> firstParamType, Class<?> secondParamType)
clazz - : 类methodName - : 要反射的类方法public static Method reflectMethod(Class<?> clazz, String methodName, Class<?> firstParamType, Class<?> secondParamType, Class<?> thirdParamType)
clazz - : 类methodName - : 要反射的类方法public static Method reflectMethod(Class<?> clazz, String methodName, Class<?> firstParamType, Class<?> secondParamType, Class<?> thirdParamType, Class<?> forthParamType)
clazz - : 类methodName - : 要反射的类方法public static Method getObjMethod(Object bean, String methodName, Class<?> firstParamType, Class<?> secondParamType)
bean - : 类实例methodName - : 要反射的类方法public static Method getObjMethod(Object bean, String methodName, String firstParam, String secondParam, String thirdParam, String fourthParam)
bean - : 类实例methodName - : 要反射的类方法public static Object execMethod(Object bean, Method method)
bean - : 类实例method - : 要反射的类方法public static Field[] reflectDeclaredFields(Object bean)
bean - : 类实例public static Object reflectField(Object bean, Field fieldName)
bean - : 类实例public static Object reflectField(Object bean, String fieldPath)
bean - : 类实例public static Object getFieldValueInObjStr(Object bean, List<Field> fieldName)
bean - : 类实例public static List<Object> getPrimaryFields(Object bean, List<String> pkList)
bean - : 类实例pkList - : 主键Listpublic static String getPrivateField(Object instance, String filedName)
instance - : 类实例filedName - : 属性NameCopyright © 2019. All rights reserved.