杰克逊图书馆:更新JsonGenerator

时间:2015-06-17 14:35:41

标签: java jackson

我有以下代码行:

StringWriter writer = new StringWriter();
JsonFactory jfactory = new JsonFactory();
JsonGenerator jGenerator = jfactory.createJsonGenerator(writer);
jGenerator.writeStartObject();
jGenerator.writeNumberField("ID", 1); //#1
.
.
//adding more fields, arrays etc... to jGenerator
.
.
jGenerator.writeEndObject();
jGenerator.close();

现在我希望在处理后用最终ID值更新#1行。有没有办法实现这个目标?

0 个答案:

没有答案