@Override public Object getFieldValue(T bean) { Object o = null; // Find and use a getter method if one is available. try { Method getterMethod = getReadMethod(bean); try { o = getterMethod.invoke(bean); } catch (IllegalAccessException | InvocationTargetException e) { // Can't happen, because we've already established that the // method is public through the use of getMethod(). } } catch (NoSuchMethodException | SecurityException e1) { // Otherwise set the field directly. o = readWithoutGetter(bean); } return o; }