public static void writeProperty(Object bean,PropertyDescriptor descriptor,Object value){
  try {
    Method writeMethod=descriptor.getWriteMethod();
    if (null == writeMethod) {
      throw new IllegalArgumentException(String.format("Missing public setter method for %s property",descriptor.getName()));
    }
    if (!writeMethod.isAccessible()) {
      writeMethod.setAccessible(true);
    }
    writeMethod.invoke(bean,new Object[]{value});
  }
 catch (  InvocationTargetException e) {
    throw new RuntimeException(e.getCause());
  }
catch (  Exception e) {
  }
}

public static void writeProperty ( Object bean , PropertyDescriptor descriptor , Object value ) { try { Method writeMethod = descriptor . getWriteMethod ( ) ; if ( null == writeMethod ) { throw new IllegalArgumentException ( String . format ( "Missing public setter method for %s property" , descriptor . getName ( ) ) ) ; } if ( ! writeMethod . isAccessible ( ) ) { writeMethod . setAccessible ( true ) ; } writeMethod . invoke ( bean , new Object [ ] { value } ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e . getCause ( ) ) ; } catch ( Exception e ) { } }
sets the contents of the given property on the given source object to the given value .
