public class ReflectionUtils extends Object
| Constructor and Description |
|---|
ReflectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
invokeReadMethod(Method method,
Object o)
call getter method and return value,or return null
|
static String |
invokeReadMethod(Method method,
Object o,
String defaultValue)
call method and get the return string value,or return defaultValue
|
static <T> T |
newInstance(Class<T> clazz) |
static Method |
readMethod(Class clazz,
String fieldName) |
static Method |
writeMethod(Class clazz,
String fieldName) |
public static String invokeReadMethod(Method method, Object o, String defaultValue)
method - methodo - which call method fromdefaultValue - default valuepublic static Object invokeReadMethod(Method method, Object o)
method - methodo - which call method frompublic static <T> T newInstance(Class<T> clazz)
Copyright © 2019. All rights reserved.