public static void setProperty(Object obj, String propertyName, final Object value) {
		Method method = getSetterMethod(obj.getClass(), propertyName, value.getClass());
		if (method != null) {
			invokeMethod(obj, method, value);
		} else {
			setFieldValue(obj, propertyName, value);
		}
	}
public static void setProperty ( Object obj , String propertyName , final Object value ) { Method method = getSetterMethod ( obj . getClass ( ) , propertyName , value . getClass ( ) ) ; if ( method != null ) { invokeMethod ( obj , method , value ) ; } else { setFieldValue ( obj , propertyName , value ) ; } }
先尝试用Setter函数写入, 如果不存在则直接写入变量, 按传入value的类型匹配函数.

性能较差, 用于单次调用的场景