From d9a218f02cce5ee675e3e2e5e426604e9593aa27 Mon Sep 17 00:00:00 2001 From: Looly Date: Sat, 26 Jun 2021 23:07:42 +0800 Subject: [PATCH] fix riter --- .../main/java/cn/hutool/json/serialize/JSONWriter.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hutool-json/src/main/java/cn/hutool/json/serialize/JSONWriter.java b/hutool-json/src/main/java/cn/hutool/json/serialize/JSONWriter.java index 286985561..e868d9926 100755 --- a/hutool-json/src/main/java/cn/hutool/json/serialize/JSONWriter.java +++ b/hutool-json/src/main/java/cn/hutool/json/serialize/JSONWriter.java @@ -61,6 +61,13 @@ public class JSONWriter { */ private boolean arrayMode; + /** + * 构造 + * @param writer {@link Writer} + * @param indentFactor 缩进因子,定义每一级别增加的缩进量 + * @param indent 本级别缩进量 + * @param config JSON选项 + */ public JSONWriter(Writer writer, int indentFactor, int indent, JSONConfig config) { this.writer = writer; this.indentFactor = indentFactor; @@ -104,6 +111,7 @@ public class JSONWriter { throw new IORuntimeException(e); } arrayMode = false; + // 当前对象或数组结束,当新的 needSeparator = true; return this; }