Write a priority field to the JSON file.

@param fieldName field name
@param value field value
356262
private void writePriorityField(String fieldName, Object value) throws IOException
   {
      m_writer.writeNameValuePair(fieldName, ((Priority) value).getValue());
   }
356462
public static void setFieldValue(Object obj, String fieldName, Object value) throws UtilException {
		Assert.notNull(obj);
		Assert.notBlank(fieldName);
		setFieldValue(obj, getField(obj.getClass(), fieldName), value);
	}
1244516
public static void setFieldValue(Object object, String fieldName, Object value) throws NoSuchFieldException {
        Field field = getDeclaredField(object, fieldName);
        if (!field.isAccessible()) {
            field.setAccessible(true);
        }
        try {
            field.set(object, value);
        } catch (IllegalAccessException e) {
            logger.error("不可能抛出的异常:{}", e.getMessage());
        }
    }
860909
public static void setFieldValue(Object target, String fieldName, Object value) {
        try {
            Field field = target.getClass().getDeclaredField(fieldName);
            field.setAccessible(true);
            field.set(target, value);
        } catch (NoSuchFieldException e) {
            throw handleException(fieldName, e);
        } catch (IllegalAccessException e) {
            throw handleException(fieldName, e);
        }
    }
964222
public void append(final StringBuffer buffer, final String fieldName, final long value) {
        appendFieldStart(buffer, fieldName);
        appendDetail(buffer, fieldName, value);
        appendFieldEnd(buffer, fieldName);
    }
870492
@JsonAnySetter
	public void handleJsonArrayToJavaString(String name, Object value) {

		try {
			PropertyUtils.setProperty(this, name,
					this.convertListToString(value));
		} catch (IllegalAccessException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		} catch (InvocationTargetException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		} catch (NoSuchMethodException e) {
			log.debug("Error setting field " + name + " with value " + value
					+ " on entity " + this.getClass().getSimpleName());
			this.additionalProperties.put(name, value);
		}

	}
693467
public void put(String fieldName, IonValue value)
    {
        checkForLock();

        validateFieldName(fieldName);
        if (value != null) validateNewChild(value);

        int lowestRemovedIndex = get_child_count();
        boolean any_removed = false;

        // first we remove the any existing fields
        // associated with fieldName (which may be none)
        if (_field_map != null && _field_map_duplicate_count == 0)
        {
            // we have a map and no duplicates so the index
            // (aka map) is all we need to find the only
            // value associated with fieldName, if there is one
            Integer idx = _field_map.get(fieldName);
            if (idx != null) {
                lowestRemovedIndex = idx.intValue();
                remove_field_from_field_map(fieldName, lowestRemovedIndex);
                remove_child(lowestRemovedIndex);
                any_removed = true;
            }
        }
        else {
            // either we don't have a map (index) or there
            // are duplicates in both cases we have to
            // scan the child list directly.
            // Walk backwards to minimize array movement
            // as we remove fields as we encounter them.
            int copies_removed = 0;
            for (int ii = get_child_count(); ii > 0; )
            {
                ii--;
                IonValueLite child = get_child(ii);
                if (fieldName.equals(child.getFieldNameSymbol().getText()))
                {
                    // done by remove_child: child.detachFromContainer();
                    remove_child(ii);
                    lowestRemovedIndex = ii;
                    copies_removed++;
                    any_removed = true;
                }
            }
            if (any_removed) {
                remove_field(fieldName, lowestRemovedIndex, copies_removed);
            }
        }
        if (any_removed) {
            patch_map_elements_helper(lowestRemovedIndex);
            patch_elements_helper(lowestRemovedIndex);
        }

        // once we've removed any existing copy we now add,
        // this (delete + add == put) turns out be be the
        // right choice since:
        //   1 - because of possible duplicates we can't
        //       guarantee the idx is stable
        //   2 - we have to maintain the hash and that
        //       really means we end up with the delete
        //       anyway
        // strictly speaking this approach, while simpler,
        // is more expensive when we don't have a has and
        // the value already exists, and it's not at the
        // end of the field list anyway.
        if (value != null) {
            add(fieldName, value);
        }
    }
861808
@JsonAnySetter
    public void set(final String name, final String value) {
        other.put(name, value);
    }
84
private static void writeValue(Object value, JsonWriter writer) throws IOException {
    if (value == null) {
      writer.nullValue();
    } else if (value instanceof Number) {
      writer.value((Number) value);
    } else if (value instanceof Boolean) {
      writer.value((Boolean) value);
    } else if (value instanceof List) {
      listToWriter((List) value, writer);
    } else if (value instanceof Map) {
      mapToWriter((Map) value, writer);
    } else if (value.getClass().isArray()) {
      arrayToWriter(value, writer);
    } else {
      writer.value(String.valueOf(value));
    }
  }
468032
public void serializePrimitive(S rec, String fieldName, double value) {
        serializePrimitive(rec, fieldName, Double.valueOf(value));
    }
1034700
@com.fasterxml.jackson.annotation.JsonProperty("FieldName")
    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }
752977
protected void onString(String text, String fieldName, JsonParser jp) {
		log.trace(fieldName + " " + text);
	}
1342144
public void addListFieldValue(String fieldName, Object value) {
		Object val = value;
		if (value instanceof DomainObject)
			val = ((DomainObject)value).getRawObject();
		Object lst = getFieldValue(fieldName, true); // internal
		
		DOField fld = getDomainObjectType().getFieldByName(fieldName);
		String ctn = fld.getComponentTypeName();
		Class<?> clazz;
		try {
			clazz = getDomainObjectType().getDomainModel().getClassForName(ctn);
			if (!clazz.isAssignableFrom(val.getClass()))
				throw new RuntimeException("value must be of type or subtype of: [" + clazz.getName() + "]");
			lst = tryInitListOrArray(lst, fld, clazz);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
		
		if (lst instanceof List<?>) {
			@SuppressWarnings("unchecked")
			List<Object> list = (List<Object>)lst;
			list.add(val);
		} else if (lst != null && lst.getClass().isArray()) {
			int len = Array.getLength(lst);
			Object array = Array.newInstance(clazz, len + 1);
			for (int i = 0; i < len; i++) {
				Array.set(array, i, Array.get(lst, i));
			}
			Array.set(array, len, val);
		} else {
			if (!getDomainObjectType().getFieldByName(fieldName).isListOrArray())
				throw new RuntimeException("field: [" + fieldName + "] is neither list nor array");
			if (lst == null)
				throw new RuntimeException("field: [" + fieldName + "] has not been initialized as list or array");
		}
	}
582131
public JsonWriter jsonValue(String value) throws IOException {
    if (value == null) {
      return nullValue();
    }
    writeDeferredName();
    beforeValue();
    out.append(value);
    return this;
  }
98970
@JsonAnySetter
    public void setOthers(String name, Object value) {
        if(name.startsWith("_")) {
            // Just be defensive
            throw new RuntimeException("This is a reserved field, and should not be treated as document content.");
        }
        this.others.put(name, value);
    }
789349
public void setValue(String fieldName, String value) {
    int index = getFieldIndex(fieldName);
    assert(index != -1);
    values[index] = value;
  }
466247
public ObjectComposer<PARENT> putObject(String fieldName, Object value)
        throws IOException, JsonProcessingException
    {
        _generator.writeObjectField(fieldName, value);
        return this;
    }