pastate imState 对象拆包
@param imValue
509859
function unpack(imValue) {
    var value;
    var valueType = Object.prototype.toString.call(imValue).slice(8, -1);
    switch (valueType) {
        case 'String':
            value = imValue + '';
            break;
        case 'Number':
            value = imValue + 0;
            break;
        case 'Boolean':
            value = imValue == true;
            break;
        case 'Array':
            value = imValue.map(function (ele) { return unpack(ele); });
            break;
        case 'Object':
            value = {};
            for (var key in imValue) {
                if (imValue.hasOwnProperty(key)) {
                    value[key] = unpack(imValue[key]);
                }
            }
            break;
        default: value = imValue;
    }
    return value;
}
367155
@SuppressWarnings({ "rawtypes", "unchecked" })
    protected Object calculatePropertyValue(Object propertyValue) {
        if (propertyValue instanceof CharSequence) {
            return propertyValue.toString();
        }
        if (propertyValue instanceof QueryableCriteria) {
            propertyValue = convertToHibernateCriteria((QueryableCriteria<?>) propertyValue);
        }
        else if (propertyValue instanceof Closure) {
            propertyValue = convertToHibernateCriteria(
                    new grails.gorm.DetachedCriteria(targetClass).build((Closure<?>) propertyValue));
        }
        return propertyValue;
    }
330891
private static void validateVarValue(String varValue) throws ApiException {
		if (varValue == null) {
			throw new ApiException(ApiException.Type.DOES_NOT_EXIST, PARAM_VAR_KEY);
		}
	}
306071
public boolean add(String inputValue) {
        String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
        if (!contains(this.genericValues, value)) {
            addElement(value);
            return true;
        }
        return false;
    }
1024243
public void setValue(Object newValue)
    {
    	if (FieldMetadata.NOT_KNOWN.equals(newValue))
    	{
            setUnknown(false);
            m_notKnown = true;
            return;
    		//throw new RuntimeException("Inconsistent use of NOT_KNOWN");
    	}
    	if (FieldMetadata.UNKNOWN.equals(newValue))
    	{
            setUnknown(true);
            m_notKnown = false;
            return;
    		//throw new RuntimeException("Inconsistent use of UNKNOWN");
    	}
        if (isDerived() && !ValidationUtils.equals(m_currentValue,newValue))
        {
            final String labelName = getPropertyMetadata().getLabelName();
            final String message = m_messageSourceAccessor.getMessage(
                    "nz.co.senanque.validationengine.derivedValue",
                    new Object[]
                    { labelName, newValue }, 
                    "Cannot set derived field.");
            throw new ValidationException(message);
        }
        m_currentValue = newValue;
        useCurrentValue(true);
        setUnknown(false);
        m_notKnown = false;
        
        addHistory(newValue);
    }
935492
public function withInitialValue($initialValue)
    {
        return new self($this->inputType, $this->objects, $this->propertyName, $initialValue);
    }
488997
function asTemplateValue(value, isAttribute) {
  var presuf = isAttribute ? '' : createHyperComment();
  switch(typeof value) {
    case 'string': return presuf + escape(value) + presuf;
    case 'boolean':
    case 'number': return presuf + value + presuf;
    case 'function': return asTemplateValue(value({}), isAttribute);
    case 'object':
      if (value instanceof Buffer) return presuf + value + presuf;
      if (value instanceof Component) return asTemplateValue(value.render(), isAttribute);
    case 'undefined':
      if (value == null) return presuf + '' + presuf;
    default:
      if (isArray(value)) {
        for (var i = 0, length = value.length; i < length; i++) {
          if (value[i] instanceof Component) {
            value[i] = value[i].render();
          }
        }
        return presuf + value.join('') + presuf;
      }
      if ('placeholder' in value) return invokeAtDistance(value, true);
      if ('text' in value) return presuf + escape(value.text) + presuf;
      if ('any' in value) return asTemplateValue(value.any, isAttribute);
      if ('html' in value) return presuf + [].concat(value.html).join('') + presuf;
      return asTemplateValue(invokeTransformer(value), isAttribute);
  }
}
1115979
public int setValue(double value, boolean bDisplayOption, int iMoveMode)
    {           // Set this field's value
        java.util.Date dateTemp = new java.util.Date((long)value);
        int iErrorCode = this.setData(dateTemp, bDisplayOption, iMoveMode);
        return iErrorCode;
    }
719261
public void setControlValue(Object objValue)
    {
        if (objValue != null)
            this.setText(objValue.toString());
        else
            this.setText(null);
    }
108294
private Object deserializeIdAttributeValue(final EntityMetadata m, String idValue)
    {
        if (idValue == null)
        {
            return null;
        }
        Class<?> embeddableClass = m.getIdAttribute().getBindableJavaType();
        Object embeddedObject = embeddedObject = KunderaCoreUtils.createNewInstance(embeddableClass);
        List<String> tokens = new ArrayList<String>();
        StringTokenizer st = new StringTokenizer((String) idValue, COMPOSITE_KEY_SEPARATOR);
        while (st.hasMoreTokens())
        {
            tokens.add((String) st.nextElement());
        }

        int count = 0;
        for (Field embeddedField : embeddableClass.getDeclaredFields())
        {
            if (!ReflectUtils.isTransientOrStatic(embeddedField))
            {
                if (count < tokens.size())
                {
                    String value = tokens.get(count++);
                    PropertyAccessorHelper.set(embeddedObject, embeddedField, value);
                }
            }
        }
        return embeddedObject;
    }
652204
public int setState(boolean state, boolean bDisplayOption, int iMoveMode)
    {
        String tempString = "N";
        if (state)
            tempString = "Y";
        return this.setString(tempString, bDisplayOption, iMoveMode); // Move value to this field
    }
1116990
public V setValue(final V iValue) {
    V oldValue = getValue();

    int index = tree.getPageIndex();
    if (dataProvider.setValueAt(index, iValue))
      markDirty();

    return oldValue;
  }
1280571
public void setControlValue(Object objValue)
    {
        if (objValue instanceof String)
            m_control.setText(objValue.toString());
        m_bDirty = false;
    }
1209247
public void setControlValue(Object objValue)
    {
        boolean bSelected = false;
        if (objValue instanceof Boolean)
        {
            bSelected = ((Boolean)objValue).booleanValue();
        }
        else if (objValue instanceof String)
        {
            String strValue = objValue.toString();
            if (strValue.length() > 0)
            {
                if ((Character.toUpperCase(strValue.charAt(0)) == 'T')
                    || (Character.toUpperCase(strValue.charAt(0)) == 'Y'))
                        bSelected = true;
            }
        }
        this.setSelected(bSelected);
    }
792337
public void setControlValue(Object objValue)
    {
        short iFieldValue = 0;
        if (objValue instanceof Short)  // Always
            iFieldValue = ((Short)objValue).shortValue();
        for (int iBitNumber = 0; iBitNumber < this.getComponentCount(); iBitNumber++)
        {
            JCheckBox checkBox = (JCheckBox)this.getComponent(iBitNumber);
            boolean bState = ((iFieldValue & (1 << iBitNumber)) != 0);
            if (!m_bCheckedIsOn)
                bState = !bState; // Do opposite operation
            checkBox.setSelected(bState);
        }
    }
80162
public static <T> void setInitialComponentValue(UIInput<T> inputComponent, T value) {
        if (value != null) {
            inputComponent.setValue(value);
        }
    }
765794
public void setValue(Object newValue) {
        Object checkedValue = checkValue(newValue);
        setDirty(isDifferent(baseValue, checkedValue));
        if (isDifferent(value, checkedValue)){ // firePropertyChange doesn't do this check sufficiently
            firePropertyChange(VALUE, value, value = checkedValue); // set inline to avoid recursion
        }
    }