@@ -305,9 +305,10 @@ public final JsonGenerator configure(Feature f, boolean state) {
305
305
306
306
307
307
/**
308
- * Bulk access method for getting state of all standard {@link Feature}s.
308
+ * Bulk access method for getting state of all standard (non-dataformat-specific)
309
+ * {@link JsonGenerator.Feature}s.
309
310
*
310
- * @return Bit mask that defines current states of all standard {@link Feature}s.
311
+ * @return Bit mask that defines current states of all standard {@link JsonGenerator. Feature}s.
311
312
*
312
313
* @since 2.3
313
314
*/
@@ -325,6 +326,60 @@ public final JsonGenerator configure(Feature f, boolean state) {
325
326
*/
326
327
public abstract JsonGenerator setFeatureMask (int values );
327
328
329
+ /**
330
+ * Bulk set method for (re)setting states of features specified by <code>mask</code>.
331
+ * Functionally equivalent to
332
+ *<code>
333
+ * int oldState = getFeatureMask();
334
+ * int newState = (oldState & ~mask) | (values & mask);
335
+ * setFeatureMask(newState);
336
+ *</code>
337
+ *
338
+ * @param values Bit mask of set/clear state for features to change
339
+ * @param mask Bit mask of features to change
340
+ *
341
+ * @since 2.6
342
+ */
343
+ public JsonGenerator overrideStdFeatures (int values , int mask ) {
344
+ int oldState = getFeatureMask ();
345
+ int newState = (oldState & ~mask ) | (values & mask );
346
+ return setFeatureMask (newState );
347
+ }
348
+
349
+ /**
350
+ * Bulk access method for getting state of all {@link FormatFeature}s, format-specific
351
+ * on/off configuration settings.
352
+ *
353
+ * @return Bit mask that defines current states of all standard {@link FormatFeature}s.
354
+ *
355
+ * @since 2.6
356
+ */
357
+ public int getFormatFeatures () {
358
+ return 0 ;
359
+ }
360
+
361
+ /**
362
+ * Bulk set method for (re)setting states of {@link FormatFeature}s,
363
+ * by specifying values (set / clear) along with a mask, to determine
364
+ * which features to change, if any.
365
+ *<p>
366
+ * Default implementation will simply throw an exception to indicate that
367
+ * the generator implementation does not support any {@link FormatFeature}s.
368
+ *
369
+ * @param values Bit mask of set/clear state for features to change
370
+ * @param mask Bit mask of features to change
371
+ *
372
+ * @since 2.6
373
+ */
374
+ public JsonGenerator overrideFormatFeatures (int values , int mask ) {
375
+ throw new IllegalArgumentException ("No FormatFeatures defined for generator of type " +getClass ().getName ());
376
+ /*
377
+ int oldState = getFeatureMask();
378
+ int newState = (oldState & ~mask) | (values & mask);
379
+ return setFeatureMask(newState);
380
+ */
381
+ }
382
+
328
383
/*
329
384
/**********************************************************
330
385
/* Public API, Schema configuration
@@ -509,9 +564,12 @@ public Object getOutputTarget() {
509
564
*
510
565
* @since 2.6
511
566
*/
567
+ public abstract int getOutputBuffered ();
568
+ /*
512
569
public int getOutputBuffered() {
513
570
return -1;
514
571
}
572
+ */
515
573
516
574
/**
517
575
* Helper method, usually equivalent to:
0 commit comments