Skip to content

Instantly share code, notes, and snippets.

@HashRaygoza
Created February 10, 2020 03:51
Show Gist options
  • Select an option

  • Save HashRaygoza/dfc8c49bf67d9876a39bebb81fe14274 to your computer and use it in GitHub Desktop.

Select an option

Save HashRaygoza/dfc8c49bf67d9876a39bebb81fe14274 to your computer and use it in GitHub Desktop.
ejemplo de como llamar un Setter
public void callSetter(Object objeto, String nombreCampo, Object valor) throws IntrospectionException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
PropertyDescriptor descriptor;
descriptor = new PropertyDescriptor(nombreCampo, objeto.getClass());
descriptor.getWriteMethod().invoke(objeto, valor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment