/* (non-Javadoc)
@see nz.co.senanque.rules.RuleSession#setValue(nz.co.senanque.rules.RuleProxyField, java.lang.Object)
540949
public void setValue(final RuleProxyField proxyField, final Object value)
    {
        final List<ProposedValue> newValues = new ArrayList<ProposedValue>();
        newValues.add(new ProposedValue(proxyField,value));
        setValues(newValues);
    }
894218
public void setValue(Object value) {

        if(LOGGER.isInfoEnabled() && !(value instanceof java.io.Serializable))
            LOGGER.info("Warning: setting a filter value tiat is not serializable.  The Filter object is serializable and should contain only serializable state");

        _value = value;
    }
1263878
public void setControlValue(Object objValue)
    {
        if (objValue instanceof String)
        {
            if (((String)objValue).equalsIgnoreCase(Constants.TRUE))
                objValue = Boolean.TRUE;
            else if (((String)objValue).equalsIgnoreCase(Constants.FALSE))
                objValue = Boolean.FALSE;
        }
        super.setControlValue(objValue);
    }
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
        }
    }
232558
public static void setValue(Object instance, String fieldName, Object value) {
        try {
            Field f = findFieldRecursively(instance.getClass(), fieldName);
            if (f == null)
                throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or superclasses");
            f.setAccessible(true);
            f.set(instance, value);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
829467
@Override
    public void set(Event<?> value) throws InvocationException {
        try {
            if (!field.isAccessible()) {
                field.setAccessible(true);
            }
            field.set(target, value);
        } catch (Exception e) {
            throw new InvocationException(e);
        }
    }
913801
private static void setFieldValue(Object entity, Field member, Object retVal)
    {
        if (member != null && retVal != null && entity != null)
        {
            PropertyAccessorHelper.set(entity, member, retVal);
        }
    }
1171102
public void setReadOnly(RuleProxyField ruleProxyField,
            RuleContext ruleContext)
    {
        if (!ruleProxyField.isReadOnly()) // only do it if the field changes
        {
            m_readOnlyFields.add(ruleProxyField.getProxyField());
            ruleContext.addReadOnly(ruleProxyField);
        }
    }
1124243
public void setValue(Object newValue) {
        synchronized (lock) {
            // Allow only once.
            if (ready) {
                return;
            }

            result = newValue;
            ready = true;
            if (waiters > 0) {
                lock.notifyAll();
            }
        }

        notifyListeners();
    }
97609
public void setValues(List<ProposedValue> values)
		throws InferenceException
	{
		m_resettingRules.clear();
        m_assignedFields.clear();
        m_readOnlyFields.clear();
        m_activateFields.clear();
        m_requiredFields.clear();
		m_excludes.clear();
		@SuppressWarnings("unused")
		int count=0;
		m_indenter.clear();
		s_log.debug("{}Setting values...",m_indenter);
		m_indenter.increment();
		for (ProposedValue pv: values)
		{
			RuleProxyField rpf = null;
			count++;
			try
			{
			    rpf = pv.getRuleProxyField();
		        addToAgenda(rpf);
				rpf.reset();
				rpf.setValue(pv.getValue());
			}
			catch (InferenceException e)
			{
                clearAgenda();
				throw e;
			}
	        finally
	        {
	        	removeUnknownField(rpf.getProxyField());
	            m_resettingRules.clear();
	            clearReviewList();
	        }
		}
		try
		{
			forwardChain();
		}
        catch (InferenceException e)
        {
            s_log.error(e.getMessage(),e);
            throw e;
        }
        catch (ConstraintViolationException e)
        {
            s_log.error(e.getMessage(),e);
            throw e;
        }
        catch (ValidationException e)
        {
            s_log.error(e.getMessage(),e);
            throw e;
        }
		finally
		{
            clearAgenda();
			m_resettingRules.clear();
            clearReviewList();
		}
		m_indenter.clear();
		// This effectively commits the changes to the exposed data
		boolean enabled = m_session.isEnabled();
		m_session.setEnabled(false);
        for (ProxyField proxyField: m_assignedFields)
        {
            proxyField.updateValue();
        }
        for (ProxyField proxyField: m_unknownFields)
        {
            proxyField.getFieldMetadata().setUnknown(true);
        }
        m_unknownFields.clear();
        for (ProxyField proxyField: m_activateFields)
        {
            proxyField.setInActive(false);
        }
        for (ProxyField proxyField: m_readOnlyFields)
        {
            proxyField.setReadOnly(true);
        }
        for (ProxyField proxyField: m_requiredFields)
        {
            proxyField.setRequired(true);
        }
        for (Exclude exclude: m_excludes)
        {
            ProxyField proxyField = exclude.getProxyField();
            proxyField.exclude(exclude.getKey());
            exclude.getRuleContext().addExclude(exclude);

        }
		m_session.setEnabled(enabled);
		s_log.debug("Finished Setting values");
	}
404220
def set(self, instance, value, **kw):
        
        proxy_field = self.get_proxy_field(instance)
        if proxy_field is None:
            return None
        # set the field with the proper field manager of the proxy field
        fieldmanager = IFieldManager(proxy_field)
        return fieldmanager.set(instance, value, **kw)
942305
@Override
    public void setValueFromObject(Object anObject) {
        if ((anObject!=null) && (value==null)) {
            if(anObject instanceof QualifiedName) {
                setValue((QualifiedName)anObject);
            } else if (anObject instanceof org.openprovenance.prov.model.LangString) { 
                setValue((org.openprovenance.prov.model.LangString)anObject);
            } else if (anObject instanceof byte[]) {
                setValueFromObject((byte[]) anObject);
            } else if (anObject instanceof org.w3c.dom.Node) {
                setValueFromObject((org.w3c.dom.Node)anObject);
            } else {
                setValue(anObject.toString());
            }
        }
900759
public void setControlValue(Object objValue)
    {
        String strValue = ZERO;
        if (objValue instanceof Integer)
            strValue = objValue.toString();
        this.setName(strValue);
    }
316806
def set(self, instance, value, **kwargs):
        
        # Retrieve the proxy object
        proxy_object = self.get_proxy(instance)

        # Return None if we could not find a proxied object, e.g. through
        # the proxy expression 'context.getSample()' on an AR
        if not proxy_object:
            logger.debug("Expression '{}' did not return a valid Proxy Object on {}"
                         .format(self.proxy, instance))
            return None

        # Lookup the proxied field by name
        field_name = self.getName()
        field = proxy_object.getField(field_name)

        # Bail out if the proxy object has no identical named field.
        if field is None:
            raise KeyError("Object '{}' with id '{}' has no field named '{}'".format(
                proxy_object.portal_type, proxy_object.getId(), field_name))

        # set the value on the proxy object
        field.set(proxy_object, value, **kwargs)

        # get the current time
        now = DateTime.DateTime()

        # update the modification date of the proxied object
        proxy_object.setModificationDate(now)

        # update the modification date of the holding object
        instance.setModificationDate(now)
59159
public void setFieldValue(Object fieldValue) {
		ReflectionUtils.callSetter(parentWrapper.getItem(), field.getName(), fieldValue);
	}
121176
public void setValue(Object instance, Object value) {
        try {
            setMethod.invoke(instance, value);
        } catch (Exception e) {
            throw new PropertyNotFoundException(klass, getType(), fieldName);
        }

    }
1141713
public final void setMaxValue(final int maxValue) {
        Condition.INSTANCE.ensureGreater(maxValue, getMinValue(),
                "The maximum value must be greater than the minimum value");
        this.maxValue = maxValue;
        setValue(Math.min(getValue(), maxValue));
    }