| 522 | } |
| 523 | |
| 524 | @Override |
| 525 | public void print(Writer w, int indent, boolean compact) throws IOException { |
| 526 | String ind = AbstractJSONObject.indent(indent); |
| 527 | w.append('{'); |
| 528 | boolean first = true; |
| 529 | String ind2 = AbstractJSONObject.indent(indent + 1); |
| 530 | for (Entry<String, JObject> obj : this.entrySet()) { |
| 531 | if (first) { |
| 532 | first = false; |
| 533 | } else { |
| 534 | w.append(','); |
| 535 | } |
| 536 | if (!compact) { |
| 537 | w.append(System.lineSeparator()); |
| 538 | w.append(ind2); |
| 539 | } |
| 540 | w.append('"'); |
| 541 | w.append(obj.getKey()); |
| 542 | w.append('"'); |
| 543 | w.append(compact ? ":" : " : "); |
| 544 | obj.getValue().print(w, indent + 1, compact); |
| 545 | } |
| 546 | if (!compact) { |
| 547 | w.append(System.lineSeparator()); |
| 548 | w.append(ind); |
| 549 | } |
| 550 | w.append('}'); |
| 551 | } |
| 552 | |
| 553 | } |
| 554 | |