private void set(Class<?> clazz, Object propertyValue, PropertyMatchResolution matchRes) throws IllegalAccessException { if (Object.class.equals(clazz) || clazz == null) { return; } Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (matchRes.matches(field, propertyValue)) { setValue(field, propertyValue); } } // check parent class fields set(clazz.getSuperclass(), propertyValue, matchRes); }
private void set(Class<?> clazz, Object propertyValue, PropertyMatchResolution matchRes) throws IllegalAccessException { if (Object.class.equals(clazz) || clazz == null) { return; } Field[] fields = clazz.getDeclaredFields(); for (Field field : fields) { if (matchRes.matches(field, propertyValue)) { setValue(field, propertyValue); } } // check parent class fields set(clazz.getSuperclass(), propertyValue, matchRes); }