/** * 设置模型值 * @param {Object} value  setModelValue: function (value) { if (!this.dataModel) return; this.dataModel.setValue(this.field, value) }, 
设置控件值
@param {Object} value
542843
function setValue(value) {
            value = this.beforeSetValue(value);
            this.trueValue = this.formater ? this.formater.format(value) : value;
            this.showValue = this.masker ? this.masker.format(this.trueValue).value : this.trueValue;
            this.setShowValue(this.showValue);
            this.slice = true;
            if (parseInt(this.options.rowIndex) > -1) {
                if ((this.options.rowIndex + '').indexOf('.') > 0) {
                    var childObj = this.getChildVariable();
                    var lastRow = childObj.lastRow;
                    var lastField = childObj.lastField;
                    if (lastRow) lastRow.setValue(lastField, this.trueValue);
                } else {
                    var rowObj = this.dataModel.getRow(this.options.rowIndex);
                    if (rowObj) rowObj.setValue(this.field, this.trueValue, undefined, undefined, this.validType); //增加validType参数--胡玥修改
                }
            } else {
                this.dataModel.setValue(this.field, this.trueValue, undefined, undefined, this.validType); //增加validType参数--胡玥修改
            }
            this.slice = false;
        }
789095
static void setModelValue(final ModelNode model, final Boolean value) {
        if (value != null) {
            model.set(value);
        }
    }
1107439
public void setList(String fieldName, List<?> value) {
		if (value == null) {
			// list默认允许传入null
			return;
		}
		fieldList.add(fieldName);
		statementParameter.setList(value);
	}
1301073
function parse (value, now) {
  now = now ? this.toDate(now) : new Date();
  if (!now) {
    return null;
  }
  // 営業日計算
  if (value.indexOf('営業日') !== -1) {
    value = suji(value);
    var matches = value.match(BIZ);
    if (matches) {
      return this.addBiz(now, matches[1] * (matches[2] === '前' ? -1 : 1));
    } else {
      return null;
    }
  // そのほか
  } else {
    return parseFn(value, this.startMonth, this._startWeek, now) ||
           toDatetimeFn(value, this.startMonth);
  }
}
352639
function setAttr(setModel, newValue, setOptions) {
      var oldValue = model._containedModels[attrName];

      // Pass through if removing
      if (newValue === undefined || newValue === null) {
        model._containedModels[attrName] = newValue;
        return;
      }

      // Is the new value the correct type?
      if (newValue instanceof Ctor) {

        // Directly set if no old value
        if (!oldValue instanceof Ctor) {
          model._containedModels[attrName] = newValue;
          return;
        }

        // They're both models.  Disregard if they're the same.
        var oldJSON = oldValue.toJSON({deep:true});
        var newJSON = newValue.toJSON({deep:true});
        if (_.isEqual(oldJSON, newJSON)) {
          return;
        }

        // Merge the raw JSON if they're both models
        newValue = newJSON;
      }

      // Keep the previous model and merge new data into it
      // For collections this relies on the Collection.set() method
      if (oldValue instanceof Ctor) {
        model.attributes[attrName] = oldValue;
        model._currentAttributes[attrName] = oldValue;
        model.changed[attrName] = oldValue;
        oldValue.set(newValue, setOptions);
        return;
      }

      // Create a new model or collection, passing the value
      newValue =
        model._containedModels[attrName] =
        model.attributes[attrName] =
        model._currentAttributes[attrName] =
        new Ctor(newValue, setOptions);

      // Watch for changes to the underlying model or collection
      // (collection add/remove), forwarding changes to this model
      newValue.on('change add remove reset', UI.onSubModelChange, {
        parent:model,
        attrName: attrName
      });
    }
20588
static void setModelValue(final ModelNode model, final String value) {
        if (value != null) {
            model.set(value);
        }
    }
671224
public function set($name, $value = null)
	{
		if (is_array($name))
		{
			// 如果传入数组就合并当前数据
			$this->data = multimerge($this->data,$name);
		}
		else
		{
			// 设置数据
			$this->data[$name] = $value;
		}
		return true;
	}
964212
public function setField($field, $value = '')
    {
        $condition = !empty($this->options['where']) ? $this->options['where'] : [];

        if (empty($condition)) {
            // 没有条件不做任何更新
            throw new Exception('no data to update');
        }

        if (is_array($field)) {
            $data = $field;
        } else {
            $data[$field] = $value;
        }

        return $this->update($data);
    }
540938
public void set(Object key, Object value) {
		for (Scope cur=this; true; cur=cur.parent) {
			// HashMap 允许有 null 值 value，必须要做 containsKey 判断
			if (cur.data != null && cur.data.containsKey(key)) {
				cur.data.put(key, value);
				return ;
			}
			
			if (cur.parent == null) {
				if (cur.data == null) {			// 支持顶层 data 为 null 值
					cur.data = new HashMap();
				}
				cur.data.put(key, value);
				return ;
			}
		}
	}
604068
function (name, value) {
            var self = this, setValue,
                // if host does not have meta info corresponding to (name,value)
                // then register on demand in order to collect all data meta info
                // 一定要注册属性元数据，否则其他模块通过 _attrs 不能枚举到所有有效属性
                // 因为属性在声明注册前可以直接设置值
                attrConfig = ensureNonEmpty(self.getAttrs(), name), setter = attrConfig.setter;    // if setter has effect
            // if setter has effect
            if (setter && (setter = normalFn(self, setter))) {
                setValue = setter.call(self, value, name);
            }
            if (setValue === INVALID) {
                return FALSE;
            }
            if (setValue !== undefined) {
                value = setValue;
            }    // finally set
            // finally set
            getAttrVals(self)[name] = value;
            return undefined;
        }
266648
public void setObject(Class<?> type, Object value) {
		if (type.equals(String.class)) {
			this.setString((String) value);
		}
		else if (type.equals(Integer.class) || type.equals(int.class)) {
			this.setInt((Integer) value);
		}
		else if (type.equals(Long.class) || type.equals(long.class)) {
			this.setLong((Long) value);
		}
		else if (type.equals(Float.class) || type.equals(float.class)) {
			this.setFloat((Float) value);
		}
		else if (type.equals(Double.class) || type.equals(double.class)) {
			this.setDouble((Double) value);
		}
		else if (type.equals(Boolean.class) || type.equals(boolean.class)) {
			if (value instanceof Integer) {
				int num = (Integer) value;
				this.setBool(num == 1);
			}
			else {
				this.setBool((Boolean) value);
			}
		}
		// else if (type.equals(Month.class)) {
		// if (value instanceof String) {
		// String month = (String) value;
		// this.setMonth(new Month(month));
		// }
		// else {
		// this.setMonth((Month) value);
		// }
		// }
		else if (type.equals(Date.class)) {
			this.setDate((Date) value);
		}
		// else if (type.equals(OnlyDate.class)) {
		// if (value instanceof java.sql.Date) {
		// java.sql.Date date = (java.sql.Date) value;
		// this.setOnlyDate(new OnlyDate(date.getTime()));
		// }
		// else {
		// this.setOnlyDate((OnlyDate) value);
		// }
		// }
		else {
			throw new IllegalArgumentException("未知类型[" + type + "].");
		}
	}
1339078
public final void setValue(Object value) {
        if (value instanceof Date) {
            content = formatDateTime((Date)value);
        } else
            if (value != null) {
                content = value.toString();
            } else {
                content = null;
            }
    }
924369
public void setValue(T object, V value) {
        try {
            if (this.setMethod != null) {
                this.setMethod.invoke(object, value);
            } else {
                this.field.set(object, value);
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
    }
776840
function setValue(object, key, value) {
  if (key in object === true) return;
  object[key] = value;
}
1071118
function(value, field) {
            if(field.parser) {
                var parser = (isFunction(field.parser)) ?
                    field.parser : null;//Y.Parsers[field.parser+''];
                if(parser) {
                    value = parser.call(this, value);
                }
                else {
                    //Y.log("Could not find parser for field " + Y.dump(field), "warn", "dataschema-json");
                }
            }
            return value;
        }
135695
public Object setValue(final Object value) {
        final Object answer = this.value;
        this.value = value;
        return answer;
    }
745818
function setValue(sName, sValue) {
				if ( typeof sValue === "undefined" || sValue === null ) {
					return;
				}
				switch (M_SETTINGS[sName].type) {
				case "boolean":
					if ( typeof sValue === "string" ) {
						if (M_SETTINGS[sName].defaultValue) {
							config[sName] = sValue.toLowerCase() != "false";
						} else {
							config[sName] = sValue.toLowerCase() === "true" || sValue.toLowerCase() === "x";
						}
					} else {
						// boolean etc.
						config[sName] = !!sValue;
					}
					break;
				case "string":
					config[sName] = "" + sValue; // enforce string
					break;
				case "code":
					config[sName] = typeof sValue === "function" ? sValue : String(sValue);
					break;
				case "function":
					if ( typeof sValue !== "function" ) {
						throw new Error("unsupported value");
					}
					config[sName] = sValue;
					break;
				case "string[]":
					if ( Array.isArray(sValue) ) {
						config[sName] = sValue;
					} else if ( typeof sValue === "string" ) {
						config[sName] = sValue.split(/[ ,;]/).map(function(s) {
							return s.trim();
						});
					} else {
						throw new Error("unsupported value");
					}
					break;
				case "object":
					if ( typeof sValue !== "object" ) {
						throw new Error("unsupported value");
					}
					config[sName] = sValue;
					break;
				case "Locale":
					var oLocale = convertToLocaleOrNull(sValue);
					if ( oLocale || M_SETTINGS[sName].defaultValue == null ) {
						config[sName] = oLocale;
					} else {
						throw new Error("unsupported value");
					}
					break;
				default:
					// When the type is none of the above types, check if an object as enum is provided to validate the value.
					var vType = M_SETTINGS[sName].type;
					if (typeof vType === "object") {
						checkEnum(vType, sValue, sName);
						config[sName] = sValue;
					} else {
						throw new Error("illegal state");
					}
				}
			}