@@ -413,7 +413,7 @@ protected Object readResolve() {
413
413
/* Capability introspection
414
414
/**********************************************************
415
415
*/
416
-
416
+
417
417
/**
418
418
* Introspection method that higher-level functionality may call
419
419
* to see whether underlying data format requires a stable ordering
@@ -459,7 +459,6 @@ protected Object readResolve() {
459
459
*
460
460
* @since 2.4
461
461
*/
462
- @ Override
463
462
public boolean canUseCharArrays () { return true ; }
464
463
465
464
/**
@@ -477,25 +476,11 @@ public boolean canParseAsync() {
477
476
return _isJSONFactory ();
478
477
}
479
478
480
- /**
481
- * Method for accessing kind of {@link FormatFeature} that a parser
482
- * {@link JsonParser} produced by this factory would accept, if any;
483
- * <code>null</code> returned if none.
484
- *
485
- * @since 2.6
486
- */
487
479
@ Override
488
480
public Class <? extends FormatFeature > getFormatReadFeatureType () {
489
481
return null ;
490
482
}
491
483
492
- /**
493
- * Method for accessing kind of {@link FormatFeature} that a parser
494
- * {@link JsonGenerator} produced by this factory would accept, if any;
495
- * <code>null</code> returned if none.
496
- *
497
- * @since 2.6
498
- */
499
484
@ Override
500
485
public Class <? extends FormatFeature > getFormatWriteFeatureType () {
501
486
return null ;
@@ -550,7 +535,6 @@ public String getFormatName()
550
535
* Convenience method for trying to determine whether input via given accessor
551
536
* is of format type supported by this factory.
552
537
*/
553
- @ Override
554
538
public MatchStrength hasFormat (InputAccessor acc ) throws IOException
555
539
{
556
540
// since we can't keep this abstract, only implement for "vanilla" instance
@@ -573,7 +557,6 @@ public MatchStrength hasFormat(InputAccessor acc) throws IOException
573
557
*
574
558
* @since 2.1
575
559
*/
576
- @ Override
577
560
public boolean requiresCustomCodec () {
578
561
return false ;
579
562
}
@@ -712,7 +695,6 @@ public final boolean isEnabled(JsonParser.Feature f) {
712
695
* Method for getting currently configured input decorator (if any;
713
696
* there is no default decorator).
714
697
*/
715
- @ Override
716
698
public InputDecorator getInputDecorator () {
717
699
return _inputDecorator ;
718
700
}
@@ -787,7 +769,6 @@ public JsonFactory setCharacterEscapes(CharacterEscapes esc) {
787
769
* Method for getting currently configured output decorator (if any;
788
770
* there is no default decorator).
789
771
*/
790
- @ Override
791
772
public OutputDecorator getOutputDecorator () {
792
773
return _outputDecorator ;
793
774
}
@@ -820,7 +801,6 @@ public JsonFactory setRootValueSeparator(String sep) {
820
801
/**
821
802
* @since 2.1
822
803
*/
823
- @ Override
824
804
public String getRootValueSeparator () {
825
805
return (_rootValueSeparator == null ) ? null : _rootValueSeparator .getValue ();
826
806
}
@@ -1217,6 +1197,208 @@ public JsonGenerator createGenerator(DataOutput out) throws IOException {
1217
1197
return createGenerator (_createDataOutputWrapper (out ), JsonEncoding .UTF8 );
1218
1198
}
1219
1199
1200
+ /*
1201
+ /**********************************************************
1202
+ /* Deprecated parser factory methods: to be removed from 3.x
1203
+ /**********************************************************
1204
+ */
1205
+
1206
+ /**
1207
+ * Method for constructing JSON parser instance to parse
1208
+ * contents of specified file.
1209
+ *<p>
1210
+ * Encoding is auto-detected from contents according to JSON
1211
+ * specification recommended mechanism. Json specification
1212
+ * supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
1213
+ * so auto-detection implemented only for this charsets.
1214
+ * For other charsets use {@link #createParser(java.io.Reader)}.
1215
+ *
1216
+ *<p>
1217
+ * Underlying input stream (needed for reading contents)
1218
+ * will be <b>owned</b> (and managed, i.e. closed as need be) by
1219
+ * the parser, since caller has no access to it.
1220
+ *
1221
+ * @param f File that contains JSON content to parse
1222
+ *
1223
+ * @deprecated Since 2.2, use {@link #createParser(File)} instead.
1224
+ */
1225
+ @ Deprecated
1226
+ public JsonParser createJsonParser (File f ) throws IOException , JsonParseException {
1227
+ return createParser (f );
1228
+ }
1229
+
1230
+ /**
1231
+ * Method for constructing JSON parser instance to parse
1232
+ * contents of resource reference by given URL.
1233
+ *
1234
+ *<p>
1235
+ * Encoding is auto-detected from contents according to JSON
1236
+ * specification recommended mechanism. Json specification
1237
+ * supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
1238
+ * so auto-detection implemented only for this charsets.
1239
+ * For other charsets use {@link #createParser(java.io.Reader)}.
1240
+ *
1241
+ *<p>
1242
+ * Underlying input stream (needed for reading contents)
1243
+ * will be <b>owned</b> (and managed, i.e. closed as need be) by
1244
+ * the parser, since caller has no access to it.
1245
+ *
1246
+ * @param url URL pointing to resource that contains JSON content to parse
1247
+ *
1248
+ * @deprecated Since 2.2, use {@link #createParser(URL)} instead.
1249
+ */
1250
+ @ Deprecated
1251
+ public JsonParser createJsonParser (URL url ) throws IOException , JsonParseException {
1252
+ return createParser (url );
1253
+ }
1254
+
1255
+ /**
1256
+ * Method for constructing JSON parser instance to parse
1257
+ * the contents accessed via specified input stream.
1258
+ *<p>
1259
+ * The input stream will <b>not be owned</b> by
1260
+ * the parser, it will still be managed (i.e. closed if
1261
+ * end-of-stream is reacher, or parser close method called)
1262
+ * if (and only if) {@link com.fasterxml.jackson.core.JsonParser.Feature#AUTO_CLOSE_SOURCE}
1263
+ * is enabled.
1264
+ *<p>
1265
+ *
1266
+ * Note: no encoding argument is taken since it can always be
1267
+ * auto-detected as suggested by JSON RFC. Json specification
1268
+ * supports only UTF-8, UTF-16 and UTF-32 as valid encodings,
1269
+ * so auto-detection implemented only for this charsets.
1270
+ * For other charsets use {@link #createParser(java.io.Reader)}.
1271
+ *
1272
+ * @param in InputStream to use for reading JSON content to parse
1273
+ *
1274
+ * @deprecated Since 2.2, use {@link #createParser(InputStream)} instead.
1275
+ */
1276
+ @ Deprecated
1277
+ public JsonParser createJsonParser (InputStream in ) throws IOException , JsonParseException {
1278
+ return createParser (in );
1279
+ }
1280
+
1281
+ /**
1282
+ * Method for constructing parser for parsing
1283
+ * the contents accessed via specified Reader.
1284
+ <p>
1285
+ * The read stream will <b>not be owned</b> by
1286
+ * the parser, it will still be managed (i.e. closed if
1287
+ * end-of-stream is reacher, or parser close method called)
1288
+ * if (and only if) {@link com.fasterxml.jackson.core.JsonParser.Feature#AUTO_CLOSE_SOURCE}
1289
+ * is enabled.
1290
+ *
1291
+ * @param r Reader to use for reading JSON content to parse
1292
+ *
1293
+ * @deprecated Since 2.2, use {@link #createParser(Reader)} instead.
1294
+ */
1295
+ @ Deprecated
1296
+ public JsonParser createJsonParser (Reader r ) throws IOException , JsonParseException {
1297
+ return createParser (r );
1298
+ }
1299
+
1300
+ /**
1301
+ * Method for constructing parser for parsing the contents of given byte array.
1302
+ *
1303
+ * @deprecated Since 2.2, use {@link #createParser(byte[])} instead.
1304
+ */
1305
+ @ Deprecated
1306
+ public JsonParser createJsonParser (byte [] data ) throws IOException , JsonParseException {
1307
+ return createParser (data );
1308
+ }
1309
+
1310
+ /**
1311
+ * Method for constructing parser for parsing
1312
+ * the contents of given byte array.
1313
+ *
1314
+ * @param data Buffer that contains data to parse
1315
+ * @param offset Offset of the first data byte within buffer
1316
+ * @param len Length of contents to parse within buffer
1317
+ *
1318
+ * @deprecated Since 2.2, use {@link #createParser(byte[],int,int)} instead.
1319
+ */
1320
+ @ Deprecated
1321
+ public JsonParser createJsonParser (byte [] data , int offset , int len ) throws IOException , JsonParseException {
1322
+ return createParser (data , offset , len );
1323
+ }
1324
+
1325
+ /**
1326
+ * Method for constructing parser for parsing
1327
+ * contents of given String.
1328
+ *
1329
+ * @deprecated Since 2.2, use {@link #createParser(String)} instead.
1330
+ */
1331
+ @ Deprecated
1332
+ public JsonParser createJsonParser (String content ) throws IOException , JsonParseException {
1333
+ return createParser (content );
1334
+ }
1335
+
1336
+ /*
1337
+ /**********************************************************
1338
+ /* Deprecated generator factory methods: to be removed from 3.x
1339
+ /**********************************************************
1340
+ */
1341
+
1342
+ /**
1343
+ * Method for constructing JSON generator for writing JSON content
1344
+ * using specified output stream.
1345
+ * Encoding to use must be specified, and needs to be one of available
1346
+ * types (as per JSON specification).
1347
+ *<p>
1348
+ * Underlying stream <b>is NOT owned</b> by the generator constructed,
1349
+ * so that generator will NOT close the output stream when
1350
+ * {@link JsonGenerator#close} is called (unless auto-closing
1351
+ * feature,
1352
+ * {@link com.fasterxml.jackson.core.JsonGenerator.Feature#AUTO_CLOSE_TARGET}
1353
+ * is enabled).
1354
+ * Using application needs to close it explicitly if this is the case.
1355
+ *<p>
1356
+ * Note: there are formats that use fixed encoding (like most binary data formats)
1357
+ * and that ignore passed in encoding.
1358
+ *
1359
+ * @param out OutputStream to use for writing JSON content
1360
+ * @param enc Character encoding to use
1361
+ *
1362
+ * @deprecated Since 2.2, use {@link #createGenerator(OutputStream, JsonEncoding)} instead.
1363
+ */
1364
+ @ Deprecated
1365
+ public JsonGenerator createJsonGenerator (OutputStream out , JsonEncoding enc ) throws IOException {
1366
+ return createGenerator (out , enc );
1367
+ }
1368
+
1369
+ /**
1370
+ * Method for constructing JSON generator for writing JSON content
1371
+ * using specified Writer.
1372
+ *<p>
1373
+ * Underlying stream <b>is NOT owned</b> by the generator constructed,
1374
+ * so that generator will NOT close the Reader when
1375
+ * {@link JsonGenerator#close} is called (unless auto-closing
1376
+ * feature,
1377
+ * {@link com.fasterxml.jackson.core.JsonGenerator.Feature#AUTO_CLOSE_TARGET} is enabled).
1378
+ * Using application needs to close it explicitly.
1379
+ *
1380
+ * @param out Writer to use for writing JSON content
1381
+ *
1382
+ * @deprecated Since 2.2, use {@link #createGenerator(Writer)} instead.
1383
+ */
1384
+ @ Deprecated
1385
+ public JsonGenerator createJsonGenerator (Writer out ) throws IOException {
1386
+ return createGenerator (out );
1387
+ }
1388
+
1389
+ /**
1390
+ * Convenience method for constructing generator that uses default
1391
+ * encoding of the format (UTF-8 for JSON and most other data formats).
1392
+ *<p>
1393
+ * Note: there are formats that use fixed encoding (like most binary data formats).
1394
+ *
1395
+ * @deprecated Since 2.2, use {@link #createGenerator(OutputStream)} instead.
1396
+ */
1397
+ @ Deprecated
1398
+ public JsonGenerator createJsonGenerator (OutputStream out ) throws IOException {
1399
+ return createGenerator (out , JsonEncoding .UTF8 );
1400
+ }
1401
+
1220
1402
/*
1221
1403
/**********************************************************
1222
1404
/* Factory methods used by factory for creating parser instances,
0 commit comments