@@ -178,6 +178,11 @@ public static int collectDefaults() {
178
178
179
179
public final static SerializableString DEFAULT_ROOT_VALUE_SEPARATOR = DefaultPrettyPrinter .DEFAULT_ROOT_VALUE_SEPARATOR ;
180
180
181
+ /**
182
+ * @since 2.10
183
+ */
184
+ public final static char DEFAULT_QUOTE_CHAR = '"' ;
185
+
181
186
/*
182
187
/**********************************************************
183
188
/* Buffer, symbol table management
@@ -276,6 +281,13 @@ public static int collectDefaults() {
276
281
*/
277
282
protected int _maximumNonEscapedChar ;
278
283
284
+ /**
285
+ * Character used for quoting field names (if field name quoting has not
286
+ * been disabled with {@link JsonWriteFeature#QUOTE_FIELD_NAMES})
287
+ * and JSON String values.
288
+ */
289
+ protected final char _quoteChar ;
290
+
279
291
/*
280
292
/**********************************************************
281
293
/* Construction
@@ -294,7 +306,10 @@ public static int collectDefaults() {
294
306
*/
295
307
public JsonFactory () { this ((ObjectCodec ) null ); }
296
308
297
- public JsonFactory (ObjectCodec oc ) { _objectCodec = oc ; }
309
+ public JsonFactory (ObjectCodec oc ) {
310
+ _objectCodec = oc ;
311
+ _quoteChar = DEFAULT_QUOTE_CHAR ;
312
+ }
298
313
299
314
/**
300
315
* Constructor used when copy()ing a factory instance.
@@ -304,14 +319,19 @@ public static int collectDefaults() {
304
319
protected JsonFactory (JsonFactory src , ObjectCodec codec )
305
320
{
306
321
_objectCodec = codec ;
322
+
323
+ // General
307
324
_factoryFeatures = src ._factoryFeatures ;
308
325
_parserFeatures = src ._parserFeatures ;
309
326
_generatorFeatures = src ._generatorFeatures ;
310
- _characterEscapes = src ._characterEscapes ;
311
327
_inputDecorator = src ._inputDecorator ;
312
328
_outputDecorator = src ._outputDecorator ;
329
+
330
+ // JSON-specific
331
+ _characterEscapes = src ._characterEscapes ;
313
332
_rootValueSeparator = src ._rootValueSeparator ;
314
333
_maximumNonEscapedChar = src ._maximumNonEscapedChar ;
334
+ _quoteChar = src ._quoteChar ;
315
335
}
316
336
317
337
/**
@@ -320,10 +340,20 @@ protected JsonFactory(JsonFactory src, ObjectCodec codec)
320
340
* @since 2.10
321
341
*/
322
342
public JsonFactory (JsonFactoryBuilder b ) {
323
- this (b , false );
343
+ _objectCodec = null ;
344
+
345
+ // General
346
+ _factoryFeatures = b ._factoryFeatures ;
347
+ _parserFeatures = b ._streamReadFeatures ;
348
+ _generatorFeatures = b ._streamWriteFeatures ;
349
+ _inputDecorator = b ._inputDecorator ;
350
+ _outputDecorator = b ._outputDecorator ;
351
+
352
+ // JSON-specific
324
353
_characterEscapes = b ._characterEscapes ;
325
354
_rootValueSeparator = b ._rootValueSeparator ;
326
355
_maximumNonEscapedChar = b ._maximumNonEscapedChar ;
356
+ _quoteChar = b ._quoteChar ;
327
357
}
328
358
329
359
/**
@@ -336,15 +366,20 @@ public JsonFactory(JsonFactoryBuilder b) {
336
366
*/
337
367
protected JsonFactory (TSFBuilder <?,?> b , boolean bogus ) {
338
368
_objectCodec = null ;
369
+
339
370
_factoryFeatures = b ._factoryFeatures ;
340
371
_parserFeatures = b ._streamReadFeatures ;
341
372
_generatorFeatures = b ._streamWriteFeatures ;
342
373
_inputDecorator = b ._inputDecorator ;
343
374
_outputDecorator = b ._outputDecorator ;
344
- // NOTE: missing _maximumNonEscapedChar since that's only in JsonFactoryBuilder
375
+
376
+ // JSON-specific: need to assign even if not really used
377
+ _characterEscapes = null ;
378
+ _rootValueSeparator = null ;
345
379
_maximumNonEscapedChar = 0 ;
380
+ _quoteChar = DEFAULT_QUOTE_CHAR ;
346
381
}
347
-
382
+
348
383
/**
349
384
* Method that allows construction of differently configured factory, starting
350
385
* with settings of this factory.
@@ -1698,7 +1733,7 @@ protected IOContext _createNonBlockingContext(Object srcRef) {
1698
1733
return new IOContext (recycler , srcRef , false );
1699
1734
}
1700
1735
1701
- /*
1736
+ /*
1702
1737
/**********************************************************
1703
1738
/* Internal helper methods
1704
1739
/**********************************************************
0 commit comments