code: private static void copyProperty(Object bean, String name, Object value) throws IllegalAccessException, InvocationTargetException {
          PropertyDescriptor propDescriptor;
          try {
              propDescriptor =
                  PropertyUtils.getPropertyDescriptor(bean, name);
          } catch (NoSuchMethodException e) {
              propDescriptor = null;
          }
          if ((propDescriptor != null) &&
              (propDescriptor.getWriteMethod() == null)) {
              propDescriptor = null;
          }
          if (propDescriptor != null) {
              Converter converter = Stapler.lookupConverter(propDescriptor.getPropertyType());
              if (converter != null)
                  value = converter.convert(propDescriptor.getPropertyType(), value);
              try {
                  PropertyUtils.setSimpleProperty(bean, name, value);
              } catch (NoSuchMethodException e) {
                  throw new NoSuchMethodError(e.getMessage());
              }
              return;
          }
  
          // try a field
          try {
              Field field = bean.getClass().getField(name);
              Converter converter = ConvertUtils.lookup(field.getType());
              if (converter != null)
                  value = converter.convert(field.getType(), value);
              field.set(bean,value);
          } catch (NoSuchFieldException e) {
              // no such field
          }
      }
docs: Sets the property/field value of the given name, by performing a value type conversion if necessary.