/** * Returns the value of the specified Field on the object bound by this {@link BindingContext} * * @param field {@link Field} to pull the value from * @param klass return type of value in the {@link Field} * @return value of type <code>klass</code> from field <code>field</code> on bound object. * @throws IllegalArgumentException if the passed {@link Field} is not a field on the object * bound by this {@link BindingContext} */ public <T> T getFieldObject(Field field, Class<T> klass) throws IllegalArgumentException { return Reflections.getFieldObject(object, field, klass); }
private static List<ObjectFieldMethod> getParameterlessMethodsOnFieldTypes(Object object, List<Field> fields) throws IllegalArgumentException { List<ObjectFieldMethod> methods = Lists.newArrayList(); for (Field field : fields) { Object fieldObject = Reflections.getFieldObject(object, field, Object.class); methods.addAll(getParameterlessMethods(fieldObject, field)); } return methods; }