Sets the given value object to the field with the field name of the target object. Is also aware of temporary
fields.
19675
private void setObjectToTargetField(String fieldname, Object value) throws Exception {
        Object toWrite = null;
        if (fieldname.contains(".")) {
            String path = StringUtils.substringBeforeLast(fieldname, ".");
            toWrite = getObjectValue(path, false);
        }
        if (toWrite == null && isTemporaryField(fieldname)) {
            String mapKey = StringUtils.substringAfter(fieldname, "#");
            mapKey = StringUtils.substringBefore(mapKey, ".");
            temporaryFields.put(mapKey, value);
            return;
        }
        String realFieldName = fieldname.contains(".") ? StringUtils.substringAfterLast(fieldname, ".") : fieldname;
        writeObjectToField(realFieldName, value, toWrite, target);
    }
696953
public static void setFieldValue(final Object target, final String name, final Object value) {
		Field field = FieldUtils.getDeclaredField(target.getClass(), name, true);

		if (field == null) {
			throw new IllegalArgumentException("Could not find field [" + name + "] on target [" + target + ']');
		}

		try {
			field.set(target, value);
		} catch (IllegalAccessException e) {
			throw new ImpossibleException(e);
		}
	}
1125927
def set_value(self, model, value):
        
        if value is None and self.required:
            raise AttributeError("This field is required.")

        if value is not None:
            value = self._converter(value)

        setattr(model, self.storage_name, value)
1170104
def set_field(self, name, value):
        """"""
        f = getattr(self, name, None)
        if isinstance(f, DataField):
            f.set(self, value)
        else:
            raise FieldError("No field named '%s'" % name)
159413
public void set(String name, Object value) {
        if (value != null) {
            attributes.put(name, String.valueOf(value));
        } else {
            attributes.remove(name);
        }

    }
73794
public void setValue(Object obj, T value) throws IllegalAccessException, InvocationTargetException {
		if (field == null) {
			setMethod.invoke(obj, value);
		} else {
			field.set(obj, value);
		}
	}
1191603
public static void setFieldValue(final Object object, final Class<?> clazz, final String fieldName,
            final Object value) throws NoSuchFieldException {
        final Field field = clazz.getDeclaredField(fieldName);

        try {
            setField(field, object, value);
        } catch (final Exception e) {
            LOG.error(e.getMessage(), e);
        }
    }
438727
public void set(Object target, Object value) {
        try {
            member.setEvenIfPrivate(target, value);
        } catch (JaversException e) {
            if (e.getCode() == JaversExceptionCode.MISSING_PROPERTY) {
                return; //swallowed
            }
            throw e;
        }
    }
930852
def set(self, field, value = None):
        
        if value is None and isinstance(field, dict):
            self.content(field)
        if field and value:
            self.data[field] = value
        return self
50471
public static void setFieldValue(final Object object, final String fieldName, final Object value) {

        final boolean success = new DerivedClassIterator(object.getClass()) {

            @Override
            protected boolean handleClass(final Class<?> clazz) {
                try {
                    setFieldValue(object, clazz, fieldName, value);
                    return true;
                } catch (final NoSuchFieldException e) {
                    LOG.debug("could not set field " + fieldName + " value " + value, e);

                }
                return false;
            }
        }.iterate();

        if (!success) {
            LOG.warn("could not set field " + fieldName + " value " + value);
        }
    }
421802
void setFieldValue(final Object containingObj, final Object value) {
        try {
            if (value == null) {
                if (primitiveType != PrimitiveType.NON_PRIMITIVE) {
                    throw new IllegalArgumentException("Tried to set primitive-typed field "
                            + field.getDeclaringClass().getName() + "." + field.getName() + " to null value");
                }
                field.set(containingObj, null);
                return;
            }
            switch (primitiveType) {
            case NON_PRIMITIVE:
                field.set(containingObj, value);
                break;
            case INTEGER:
                if (!(value instanceof Integer)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Integer; got " + value.getClass().getName());
                }
                field.setInt(containingObj, (Integer) value);
                break;
            case LONG:
                if (!(value instanceof Long)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Long; got " + value.getClass().getName());
                }
                field.setLong(containingObj, (Long) value);
                break;
            case SHORT:
                if (!(value instanceof Short)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Short; got " + value.getClass().getName());
                }
                field.setShort(containingObj, (Short) value);
                break;
            case DOUBLE:
                if (!(value instanceof Double)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Double; got " + value.getClass().getName());
                }
                field.setDouble(containingObj, (Double) value);
                break;
            case FLOAT:
                if (!(value instanceof Float)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Float; got " + value.getClass().getName());
                }
                field.setFloat(containingObj, (Float) value);
                break;
            case BOOLEAN:
                if (!(value instanceof Boolean)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Boolean; got " + value.getClass().getName());
                }
                field.setBoolean(containingObj, (Boolean) value);
                break;
            case BYTE:
                if (!(value instanceof Byte)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Byte; got " + value.getClass().getName());
                }
                field.setByte(containingObj, (Byte) value);
                break;
            case CHARACTER:
                if (!(value instanceof Character)) {
                    throw new IllegalArgumentException(
                            "Expected value of type Character; got " + value.getClass().getName());
                }
                field.setChar(containingObj, (Character) value);
                break;
            default:
                throw new IllegalArgumentException();
            }
        } catch (IllegalArgumentException | IllegalAccessException e) {
            throw new IllegalArgumentException(
                    "Could not set field " + field.getDeclaringClass().getName() + "." + field.getName(), e);
        }
    }
248032
public static void set(Object target, Field field, Object value)
    {
        if (target != null)
        {
            if (!field.isAccessible())
            {
                field.setAccessible(true);
            }
            try
            {
                field.set(target, value);
            }
            catch (IllegalArgumentException iarg)
            {
                throw new PropertyAccessException(iarg);
            }
            catch (IllegalAccessException iacc)
            {
                throw new PropertyAccessException(iacc);
            }
        } // ignore if object is null;
    }
509796
def set_value(self, field_name, value):
        
        if field_name in self.fields:
            if not value is None:
                self._dict['attributes'][field_name] = _unicode_convert(value)
            else:
                pass
        elif field_name.upper() in ['SHAPE', 'SHAPE@', "GEOMETRY"]:
            if isinstance(value, dict):
                if 'geometry' in value:
                    self._dict['geometry'] = value['geometry']
                elif any(k in value.keys() for k in ['x','y','points','paths','rings', 'spatialReference']):
                    self._dict['geometry'] = value
            elif isinstance(value, AbstractGeometry):
                self._dict['geometry'] = value.asDictionary
            elif arcpyFound:
                if isinstance(value, arcpy.Geometry) and \
                   value.type == self.geometryType:
                    self._dict['geometry']=json.loads(value.JSON)
            self._geom = None
            self._geom = self.geometry
        else:
            return False
        self._json = json.dumps(self._dict, default=_date_handler)
        return True
184274
public static void setField(Object obj, Field field, Object value) {
        boolean accessible = field.isAccessible();
        //hack accessibility
        if (!accessible) {
            field.setAccessible(true);
        }
        try {
            field.set(obj, value);
        } catch (IllegalAccessException e) {
            //ignore should not happen as accessibility has been updated to suit assignment
            e.printStackTrace(); // $COVERAGE-IGNORE$
        }
        //restore accessibility
        field.setAccessible(accessible);
    }
273474
def set_value(self, obj, value):
        """"""
        if value:
            obj.set_field_value(self.name, value)
        else:
            self.delete_value(obj)
389352
def set_value_field(self, model, field_name):
        
        fields = fields_for_model(model, fields=[field_name])
        self.fields['value'] = fields[field_name]
238511
public static void setField(final Object obj, Field field, final Object value) {
		try {
			field.set(obj, value);
		} catch (Exception e) {
			throw convertReflectionExceptionToUnchecked(e);
		}
	}