Ejemplo n.º 1
0
 @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(']');
 }
Ejemplo n.º 2
0
 @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('}');
 }
Ejemplo n.º 3
0
 @Override
 public void writeStartArray(JsonGenerator jg) throws IOException {
   if (!_arrayIndenter.isInline()) {
     ++_nesting;
   }
   jg.writeRaw('[');
 }
Ejemplo n.º 4
0
 @Override
 public void writeStartObject(JsonGenerator jg) throws IOException {
   jg.writeRaw('{');
   if (!_objectIndenter.isInline()) {
     ++_nesting;
   }
 }
Ejemplo n.º 5
0
 /**
  * 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);
 }
Ejemplo n.º 6
0
 @Override
 public void beforeArrayValues(JsonGenerator jg) throws IOException {
   _arrayIndenter.writeIndentation(jg, _nesting);
 }
Ejemplo n.º 7
0
 /**
  * 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);
 }
Ejemplo n.º 8
0
 @Override
 public void beforeObjectEntries(JsonGenerator jg) throws IOException {
   _objectIndenter.writeIndentation(jg, _nesting);
 }