@@ -152,20 +152,20 @@ public final JsonGenerator configure(StreamWriteFeature f, boolean state) {
152
152
/**********************************************************************
153
153
*/
154
154
155
- //public void writeStartArray()
156
- //public void writeEndArray()
157
- //public void writeStartObject()
158
- //public void writeEndObject()
155
+ //public JsonGenerator writeStartArray()
156
+ //public JsonGenerator writeEndArray()
157
+ //public JsonGenerator writeStartObject()
158
+ //public JsonGenerator writeEndObject()
159
159
160
160
@ Override
161
- public void writeStartArray (Object forValue , int size ) throws JacksonException {
162
- writeStartArray (forValue );
161
+ public JsonGenerator writeStartArray (Object forValue , int size ) throws JacksonException {
162
+ return writeStartArray (forValue );
163
163
}
164
164
165
165
@ Override
166
- public void writeStartObject (Object forValue , int size ) throws JacksonException
166
+ public JsonGenerator writeStartObject (Object forValue , int size ) throws JacksonException
167
167
{
168
- writeStartObject (forValue );
168
+ return writeStartObject (forValue );
169
169
}
170
170
171
171
/*
@@ -174,47 +174,48 @@ public void writeStartObject(Object forValue, int size) throws JacksonException
174
174
/**********************************************************************
175
175
*/
176
176
177
- @ Override public void writeName (SerializableString name ) throws JacksonException {
178
- writeName (name .getValue ());
177
+ @ Override
178
+ public JsonGenerator writeName (SerializableString name ) throws JacksonException {
179
+ return writeName (name .getValue ());
179
180
}
180
181
181
- //public abstract void writeString(String text);
182
+ //public abstract JsonGenerator writeString(String text);
182
183
183
- //public abstract void writeString(char[] text, int offset, int len);
184
+ //public abstract JsonGenerator writeString(char[] text, int offset, int len);
184
185
185
186
@ Override
186
- public void writeString (Reader reader , int len ) throws JacksonException {
187
+ public JsonGenerator writeString (Reader reader , int len ) throws JacksonException {
187
188
// Let's implement this as "unsupported" to make it easier to add new parser impls
188
- _reportUnsupportedOperation ();
189
+ return _reportUnsupportedOperation ();
189
190
}
190
-
191
- //public abstract void writeRaw(String text);
192
191
193
- //public abstract void writeRaw(char[] text, int offset, int len);
192
+ //public abstract JsonGenerator writeRaw(String text);
193
+
194
+ //public abstract JsonGenerator writeRaw(char[] text, int offset, int len);
194
195
195
196
@ Override
196
- public void writeString (SerializableString text ) throws JacksonException {
197
- writeString (text .getValue ());
197
+ public JsonGenerator writeString (SerializableString text ) throws JacksonException {
198
+ return writeString (text .getValue ());
198
199
}
199
200
200
- @ Override public void writeRawValue (String text ) throws JacksonException {
201
+ @ Override public JsonGenerator writeRawValue (String text ) throws JacksonException {
201
202
_verifyValueWrite ("write raw value" );
202
- writeRaw (text );
203
+ return writeRaw (text );
203
204
}
204
205
205
- @ Override public void writeRawValue (String text , int offset , int len ) throws JacksonException {
206
+ @ Override public JsonGenerator writeRawValue (String text , int offset , int len ) throws JacksonException {
206
207
_verifyValueWrite ("write raw value" );
207
- writeRaw (text , offset , len );
208
+ return writeRaw (text , offset , len );
208
209
}
209
210
210
- @ Override public void writeRawValue (char [] text , int offset , int len ) throws JacksonException {
211
+ @ Override public JsonGenerator writeRawValue (char [] text , int offset , int len ) throws JacksonException {
211
212
_verifyValueWrite ("write raw value" );
212
- writeRaw (text , offset , len );
213
+ return writeRaw (text , offset , len );
213
214
}
214
215
215
- @ Override public void writeRawValue (SerializableString text ) throws JacksonException {
216
+ @ Override public JsonGenerator writeRawValue (SerializableString text ) throws JacksonException {
216
217
_verifyValueWrite ("write raw value" );
217
- writeRaw (text );
218
+ return writeRaw (text );
218
219
}
219
220
220
221
@ Override
@@ -249,7 +250,7 @@ public abstract void writeNull()
249
250
*/
250
251
251
252
@ Override
252
- public void writePOJO (Object value ) throws JacksonException {
253
+ public JsonGenerator writePOJO (Object value ) throws JacksonException {
253
254
if (value == null ) {
254
255
// important: call method that does check value write:
255
256
writeNull ();
@@ -259,16 +260,18 @@ public void writePOJO(Object value) throws JacksonException {
259
260
// state would advance causing exception later on
260
261
_objectWriteContext .writeValue (this , value );
261
262
}
263
+ return this ;
262
264
}
263
265
264
266
@ Override
265
- public void writeTree (TreeNode rootNode ) throws JacksonException {
267
+ public JsonGenerator writeTree (TreeNode rootNode ) throws JacksonException {
266
268
// As with 'writeObject()', we are not to check if write would work
267
269
if (rootNode == null ) {
268
270
writeNull ();
269
271
} else {
270
272
_objectWriteContext .writeTree (this , rootNode );
271
273
}
274
+ return this ;
272
275
}
273
276
274
277
/*
0 commit comments