public String resultValue(String objValueTemp, TmpContractInfo tmpContractInfo) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { Class<TmpContractInfo> clazz = TmpContractInfo.class; Method method = clazz.getDeclaredMethod(objValueTemp); Object objValue = method.invoke(tmpContractInfo); String value = null; if (objValue != null && objValue instanceof String) { value = (String) objValue; } return value; }