Writes a JSON object key and value.

@param key  the item key
@param value  the item value
@throws IOException if an error occurs
330979
void writeObjectKeyValue(String key, String value) throws IOException {
        writeObjectKey(key);
        writeString(value);
    }
676641
public JsonObject<V> addData(String key, Object value) {
        if (key == null) {
            return this;
        }
        if (this.data == null) {
            this.data = new HashMap<String, Object>();
        }
        this.data.put(key, value);
        return this;
    }
1358931
public void setData(String key, Object value) {
        this.data = this.data.addData(key, value);
    }
19265
protected void writeMapEntry(String key, Object value, CharBuf buffer) {
        buffer.addJsonFieldName(key, disableUnicodeEscaping);
        writeObject(key, value, buffer);
    }
647631
private void writeObject(JsonGenerator jsonGenerator, Object entity) throws IOException {
        jsonGenerator.writeStartObject();

        writeName(jsonGenerator, entity);
        writeKind(jsonGenerator, entity);
        writeURL(jsonGenerator, entity);

        jsonGenerator.writeEndObject();
    }
815692
public JsonWriter value(String value) throws IOException {
        if (value == null) {
            return nullValue();
        }
        beforeValue(false);
        string(value);
        return this;
    }
483069
public void write(JsonGenerator jsonGenerator) throws IOException {
    jsonGenerator.writeStartObject();
    jsonGenerator.writeStringField("poolGroupName", poolGroupName);
    jsonGenerator.writeStringField("poolName", poolName);
    jsonGenerator.writeEndObject();
  }
1112703
public JsonWriter writeValue(Boolean value) throws IOException {
        if (!willWriteValue) {
            indent();
        }
        writer.write(value.toString());
        willWriteValue = false;
        return this;
    }
526072
public static void writeJsonProperty(JsonWriter writer, String name,
                                         Object value, MappingRules mapping)
            throws RepositoryException, IOException {
        if (name != null && value != null) {
            int type = PropertyType.STRING;
            if (value instanceof Boolean) {
                type = PropertyType.BOOLEAN;
            } else if (value instanceof Long || value instanceof Integer) {
                type = PropertyType.LONG;
            } else if (value instanceof Double || value instanceof Float) {
                type = PropertyType.DOUBLE;
            } else if (value instanceof BigDecimal) {
                type = PropertyType.DECIMAL;
            } else if (value instanceof Calendar) {
                type = PropertyType.DATE;
            }
            if (mapping.propertyFormat.scope != MappingRules.PropertyFormat.Scope.value) {
                writer.beginObject();
            }
            if (mapping.propertyFormat.scope == MappingRules.PropertyFormat.Scope.value) {
                writer.name(name);
            } else {
                writer.name("name").value(name);
                writer.name("value");
            }
            if (value instanceof Object[]) {
                writer.beginArray();
                for (Object val : (Object[]) value) {
                    JsonUtil.writeJsonValue(writer, null, name, val, type, mapping);
                }
                writer.endArray();
            } else {
                JsonUtil.writeJsonValue(writer, null, name, value, type, mapping);
            }
            if (mapping.propertyFormat.scope != MappingRules.PropertyFormat.Scope.value) {
                writer.name("type").value(PropertyType.nameFromValue(type));
                writer.name("multi").value(value instanceof Object[]);
                writer.endObject();
            }
        }
    }
227042
public void put(String key, Object object, boolean serialize){
        if(serialize)
            put(key,gson.toJson(object));
        else
            put(key,object);
    }
317847
private void writeFields(JsonWriterImpl out, Object value)
  {
    for (JsonField field : _fields) {
      field.write(out, value);
    }
  }
450792
void writeString(String value) throws IOException {
        output.append('"');
        for (int i = 0; i < value.length(); i++) {
            char ch = value.charAt(i);
            if (ch < 128) {
                String replace = REPLACE[ch];
                if (replace != null) {
                    output.append(replace);
                } else {
                    output.append(ch);
                }
            } else if (ch == '\u2028') {
                output.append("\\u2028");  // match other JSON writers
            } else if (ch == '\u2029') {
                output.append("\\u2029");  // match other JSON writers
            } else {
                output.append(ch);
            }
        }
        output.append('"');
    }
220967
public JSONObject put(String key, Map<?, ?> value) throws JSONException {
		this.put(key, new JSONObject(value));
		return this;
	}
670570
public static void save(String key, Object object) throws Exception {
        String json = new Gson().toJson(object);
        cache.put(key, json);
    }
883439
public final void writeNumberField(String fieldName, int value)
        throws IOException, JsonGenerationException
    {
        writeFieldName(fieldName);
        writeNumber(value);
    }
480608
public void writeStringField(String fieldName, String value)
        throws IOException, JsonGenerationException
    {
        writeFieldName(fieldName);
        writeString(value);
    }
515589
public JSONObject put(String key, int value) throws JSONException {
        put(key, Integer.valueOf(value));
        return this;
    }