Java Code Examples for org.apache.commons.lang.reflect.MethodUtils#invokeMethod()

The following examples show how to use org.apache.commons.lang.reflect.MethodUtils#invokeMethod() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TaskThroughput.java    From hiped2 with Apache License 2.0 4 votes vote down vote up
public static long extractLongFieldValue(TaskMetrics m,
                                         String fieldName)
    throws IllegalAccessException, InvocationTargetException,
    NoSuchMethodException {
  return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
 
Example 2
Source File: DataSkewMetrics.java    From hiped2 with Apache License 2.0 4 votes vote down vote up
public static long extractLongFieldValue(TaskMetrics m,
                                         String fieldName)
    throws IllegalAccessException, InvocationTargetException,
    NoSuchMethodException {
  return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
 
Example 3
Source File: JobHistoryHelper.java    From hiped2 with Apache License 2.0 4 votes vote down vote up
public static long extractLongFieldValue(TaskMetrics m,
                                         String fieldName)
    throws IllegalAccessException, InvocationTargetException,
    NoSuchMethodException {
  return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
 
Example 4
Source File: MetricSummary.java    From hiped2 with Apache License 2.0 4 votes vote down vote up
public static long extractLongFieldValue(TaskMetrics m,
                                         String fieldName)
    throws IllegalAccessException, InvocationTargetException,
    NoSuchMethodException {
  return (Long) MethodUtils.invokeMethod(m, fieldName, null);
}
 
Example 5
Source File: PropertyUtils.java    From openhab1-addons with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * 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);
}