@Override public void writeEndArray(JsonGenerator gen, int nrOfValues) throws IOException { if (!_arrayIndenter.isInline()) { --_nesting; } if (nrOfValues > 0) { _arrayIndenter.writeIndentation(gen, _nesting); } else { gen.writeRaw(' '); } gen.writeRaw(']'); }
@Override public void writeEndObject(JsonGenerator jg, int nrOfEntries) throws IOException { if (!_objectIndenter.isInline()) { --_nesting; } if (nrOfEntries > 0) { _objectIndenter.writeIndentation(jg, _nesting); } else { jg.writeRaw(' '); } jg.writeRaw('}'); }
@Override public void writeStartArray(JsonGenerator jg) throws IOException { if (!_arrayIndenter.isInline()) { ++_nesting; } jg.writeRaw('['); }
@Override public void writeStartObject(JsonGenerator jg) throws IOException { jg.writeRaw('{'); if (!_objectIndenter.isInline()) { ++_nesting; } }
/** * Method called after an array value has been completely output, and before another value is to * be output. * * <p>Default handling (without pretty-printing) will output a single comma to separate the two. * Pretty-printer is to output a comma as well, but can surround that with other (white-space) * decoration. */ @Override public void writeArrayValueSeparator(JsonGenerator gen) throws IOException { gen.writeRaw(','); _arrayIndenter.writeIndentation(gen, _nesting); }
@Override public void beforeArrayValues(JsonGenerator jg) throws IOException { _arrayIndenter.writeIndentation(jg, _nesting); }
/** * Method called after an object entry (field:value) has been completely output, and before * another value is to be output. * * <p>Default handling (without pretty-printing) will output a single comma to separate the two. * Pretty-printer is to output a comma as well, but can surround that with other (white-space) * decoration. */ @Override public void writeObjectEntrySeparator(JsonGenerator jg) throws IOException { jg.writeRaw(','); _objectIndenter.writeIndentation(jg, _nesting); }
@Override public void beforeObjectEntries(JsonGenerator jg) throws IOException { _objectIndenter.writeIndentation(jg, _nesting); }