code: public void setPropertyValue(Object instance, Object value, boolean forceDirect) {
          try {
              if (!forceDirect && instance instanceof IPropertyAccessor) {
                  ((IPropertyAccessor) instance).setPropertyValue(this, value);
                  return;
              }
              
              Method method = null;
              
              try {
                  method = PropertyUtil.findSetter(setter, instance, value == null ? null : value.getClass());
              } catch (Exception e) {
                  if (value != null) {
                      PropertySerializer<?> serializer = getPropertyType().getSerializer();
                      value = value instanceof String ? serializer.deserialize((String) value) : serializer.serialize(value);
                      method = PropertyUtil.findSetter(setter, instance, value.getClass());
                  } else {
                      throw e;
                  }
              }
              
              if (method != null) {
                  method.invoke(instance, value);
              }
          } catch (Exception e) {
              throw MiscUtil.toUnchecked(e);
          }
      }
docs: Sets the property value for a specified object instance.
  
  @param instance The object instance.
  @param value The value to assign.
  @param forceDirect If true, a forces a direct write to the instance even if it implements
  IPropertyAccessor