@Override public JsonGenerator write(long value) { checkContextForValue(); writeValue(String.valueOf(value)); popFieldContext(); return this; }
@Override public JsonGenerator write(BigDecimal value) { checkContextForValue(); writeValue(value.toString()); popFieldContext(); return this; }
@Override public JsonGenerator write(BigInteger value) { checkContextForValue(); writeValue(value.toString()); popFieldContext(); return this; }
@Override public JsonGenerator write(double value) { checkContextForValue(); if (Double.isInfinite(value) || Double.isNaN(value)) { throw new NumberFormatException(JsonMessages.GENERATOR_DOUBLE_INFINITE_NAN()); } writeValue(String.valueOf(value)); popFieldContext(); return this; }
@Override public JsonGenerator writeEnd() { if (currentContext.scope == Scope.IN_NONE) { throw new JsonGenerationException("writeEnd() cannot be called in no context"); } writeChar(currentContext.scope == Scope.IN_ARRAY ? ']' : '}'); currentContext = stack.pop(); popFieldContext(); return this; }
@Override public JsonGenerator write(boolean value) { checkContextForValue(); writeComma(); writeString(value ? "true" : "false"); popFieldContext(); return this; }
@Override public JsonGenerator write(String value) { checkContextForValue(); writeComma(); writeEscapedString(value); popFieldContext(); return this; }
@Override public JsonGenerator write(int value) { checkContextForValue(); writeComma(); writeInt(value); popFieldContext(); return this; }
@Override public JsonGenerator writeNull() { checkContextForValue(); writeComma(); writeString("null"); popFieldContext(); return this; }
JsonNumber number = (JsonNumber)value; writeValue(number.toString()); popFieldContext(); break; case TRUE:
@Override public JsonGenerator write(long value) { checkContextForValue(); writeValue(String.valueOf(value)); popFieldContext(); return this; }
@Override public JsonGenerator write(BigDecimal value) { checkContextForValue(); writeValue(value.toString()); popFieldContext(); return this; }
@Override public JsonGenerator write(double value) { checkContextForValue(); if (Double.isInfinite(value) || Double.isNaN(value)) { throw new NumberFormatException(JsonMessages.GENERATOR_DOUBLE_INFINITE_NAN()); } writeValue(String.valueOf(value)); popFieldContext(); return this; }
@Override public JsonGenerator writeEnd() { if (currentContext.scope == Scope.IN_NONE) { throw new JsonGenerationException("writeEnd() cannot be called in no context"); } writeChar(currentContext.scope == Scope.IN_ARRAY ? ']' : '}'); currentContext = stack.pop(); popFieldContext(); return this; }
@Override public JsonGenerator write(BigInteger value) { checkContextForValue(); writeValue(value.toString()); popFieldContext(); return this; }
@Override public JsonGenerator writeNull() { checkContextForValue(); writeComma(); writeString("null"); popFieldContext(); return this; }
@Override public JsonGenerator write(String value) { checkContextForValue(); writeComma(); writeEscapedString(value); popFieldContext(); return this; }
@Override public JsonGenerator write(boolean value) { checkContextForValue(); writeComma(); writeString(value ? "true" : "false"); popFieldContext(); return this; }
@Override public JsonGenerator write(int value) { checkContextForValue(); writeComma(); writeInt(value); popFieldContext(); return this; }
JsonNumber number = (JsonNumber)value; writeValue(number.toString()); popFieldContext(); break; case TRUE: