下面列出了org.apache.commons.lang.reflect.MethodUtils#invokeMethod ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
public static long extractLongFieldValue(TaskMetrics m,
String fieldName)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
public static long extractLongFieldValue(TaskMetrics m,
String fieldName)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
public static long extractLongFieldValue(TaskMetrics m,
String fieldName)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
public static long extractLongFieldValue(TaskMetrics m,
String fieldName)
throws IllegalAccessException, InvocationTargetException,
NoSuchMethodException {
return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
/**
* Returns the getter value from the object instance, nested properties are
* possible. If the propertyName is for example temperature.current, the
* methods getTemperature().getCurrent() are called.
*/
public static Object getPropertyValue(Object instance, String property) throws Exception {
Object object = getNestedObject(instance, property);
String getMethod = toGetterString(PropertyResolver.last(property));
return MethodUtils.invokeMethod(object, getMethod, null);
}