/** Writes the specified JSON value, without quoting or escaping. */ public JsonWriter json (String json) throws IOException { requireCommaOrName(); writer.write(json); return this; }
/** Writes the specified JSON value, without quoting or escaping. */ public JsonWriter json (String json) throws IOException { requireCommaOrName(); writer.write(json); return this; }
public JsonWriter value (Object value) throws IOException { if (quoteLongValues && (value instanceof Long || value instanceof Double || value instanceof BigDecimal || value instanceof BigInteger)) { value = value.toString(); } else if (value instanceof Number) { Number number = (Number)value; long longValue = number.longValue(); if (number.doubleValue() == longValue) value = longValue; } requireCommaOrName(); writer.write(outputType.quoteValue(value)); return this; }
public JsonWriter value (Object value) throws IOException { if (quoteLongValues && (value instanceof Long || value instanceof Double || value instanceof BigDecimal || value instanceof BigInteger)) { value = value.toString(); } else if (value instanceof Number) { Number number = (Number)value; long longValue = number.longValue(); if (number.doubleValue() == longValue) value = longValue; } requireCommaOrName(); writer.write(outputType.quoteValue(value)); return this; }
public JsonWriter array () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(true)); return this; }
public JsonWriter object () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(false)); return this; }
public JsonWriter array () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(true)); return this; }
public JsonWriter object () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(false)); return this; }
/** Writes the specified JSON value, without quoting or escaping. */ public JsonWriter json (String json) throws IOException { requireCommaOrName(); writer.write(json); return this; }
public JsonWriter value (Object value) throws IOException { if (quoteLongValues && (value instanceof Long || value instanceof Double || value instanceof BigDecimal || value instanceof BigInteger)) { value = value.toString(); } else if (value instanceof Number) { Number number = (Number)value; long longValue = number.longValue(); if (number.doubleValue() == longValue) value = longValue; } requireCommaOrName(); writer.write(outputType.quoteValue(value)); return this; }
public JsonWriter object () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(false)); return this; }
public JsonWriter array () throws IOException { requireCommaOrName(); stack.add(current = new JsonObject(true)); return this; }