MCPcopy Create free account
hub / github.com/cschanck/single-file-java / print

Method print

src/main/java/org/sfj/JSONOne.java:359–383  ·  view source on GitHub ↗
(Writer w, int indent, boolean compact)

Source from the content-addressed store, hash-verified

357 }
358
359 @Override
360 public void print(Writer w, int indent, boolean compact) throws IOException {
361 String ind1 = AbstractJSONObject.indent(indent);
362 String ind2 = AbstractJSONObject.indent(indent + 1);
363 w.append('[');
364
365 boolean first = true;
366 for (JObject obj : this) {
367 if (first) {
368 first = false;
369 } else {
370 w.append(',');
371 }
372 if (!compact) {
373 w.append(System.lineSeparator());
374 w.append(ind2);
375 }
376 obj.print(w, indent + 1, compact);
377 }
378 if (!compact) {
379 w.append(System.lineSeparator());
380 w.append(ind1);
381 }
382 w.append(']');
383 }
384 }
385
386 /**

Callers

nothing calls this directly

Calls 3

indentMethod · 0.95
appendMethod · 0.65
printMethod · 0.65

Tested by

no test coverage detected