private void writeValue(String value) { writeComma(); writeString(value); }
private JsonGenerator writeName(String name) { writeComma(); writeEscapedString(name); writeColon(); return this; }
@Override protected void writeComma() { super.writeComma(); writeChar('\n'); writeIndent(); }
@Override public JsonGenerator write(boolean value) { checkContextForValue(); writeComma(); writeString(value ? "true" : "false"); popFieldContext(); return this; }
private void writeValue(String name, String value) { writeComma(); writeEscapedString(name); writeColon(); writeString(value); }
@Override public JsonGenerator write(String value) { checkContextForValue(); writeComma(); writeEscapedString(value); popFieldContext(); return this; }
@Override public JsonGenerator writeNull() { checkContextForValue(); writeComma(); writeString("null"); popFieldContext(); return this; }
@Override public JsonGenerator write(int value) { checkContextForValue(); writeComma(); writeInt(value); popFieldContext(); return this; }
@Override public JsonGenerator writeStartArray() { if (currentContext.scope == Scope.IN_OBJECT) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope)); } if (currentContext.scope == Scope.IN_NONE && !currentContext.first) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_MULTIPLE_TEXT()); } writeComma(); writeChar('['); stack.push(currentContext); currentContext = new Context(Scope.IN_ARRAY); return this; }
@Override public JsonGenerator writeStartObject() { if (currentContext.scope == Scope.IN_OBJECT) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope)); } if (currentContext.scope == Scope.IN_NONE && !currentContext.first) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_MULTIPLE_TEXT()); } writeComma(); writeChar('{'); stack.push(currentContext); currentContext = new Context(Scope.IN_OBJECT); return this; }
private void writeValue(String value) { writeComma(); writeString(value); }
private JsonGenerator writeName(String name) { writeComma(); writeEscapedString(name); writeColon(); 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 protected void writeComma() { super.writeComma(); if (isCommaAllowed()) { writeChar('\n'); writeIndent(); } }
@Override public JsonGenerator write(int value) { checkContextForValue(); writeComma(); writeInt(value); popFieldContext(); return this; }
private void writeValue(String name, String value) { writeComma(); writeEscapedString(name); writeColon(); writeString(value); }
@Override public JsonGenerator writeStartObject() { if (currentContext.scope == Scope.IN_OBJECT) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope)); } if (currentContext.scope == Scope.IN_NONE && !currentContext.first) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_MULTIPLE_TEXT()); } writeComma(); writeChar('{'); stack.push(currentContext); currentContext = new Context(Scope.IN_OBJECT); return this; }
@Override public JsonGenerator writeStartArray() { if (currentContext.scope == Scope.IN_OBJECT) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope)); } if (currentContext.scope == Scope.IN_NONE && !currentContext.first) { throw new JsonGenerationException(JsonMessages.GENERATOR_ILLEGAL_MULTIPLE_TEXT()); } writeComma(); writeChar('['); stack.push(currentContext); currentContext = new Context(Scope.IN_ARRAY); return this; }