Assuming that there is no special logic in a field set method, What would be the best practice to set field's value using reflections? would it be
field.set(obj, value);
or
method = obj.getClass().getMethod("setSomething", parameter.class);
method.invoke(obj, argument);
Aucun commentaire:
Enregistrer un commentaire