@@ -1297,12 +1297,15 @@ public JsonParser createParser(File src) throws IOException {
1297
1297
1298
1298
/**
1299
1299
* Factory method for constructing properly initialized {@link JsonParser}
1300
- * to read content from specified {@link File }.
1300
+ * to read content from specified {@link URL }.
1301
1301
* Parser is not managed (or "owned") by ObjectMapper: caller is responsible
1302
1302
* for properly closing it once content reading is complete.
1303
1303
*
1304
1304
* @since 2.11
1305
+ *
1306
+ * @deprecated since 2.20 deprecated as it calls {@link JsonFactory#createParser(URL)}.
1305
1307
*/
1308
+ @ Deprecated // @since 2.20
1306
1309
public JsonParser createParser (URL src ) throws IOException {
1307
1310
_assertNotNull ("src" , src );
1308
1311
return _deserializationConfig .initialize (_jsonFactory .createParser (src ));
@@ -3346,11 +3349,14 @@ public JsonNode readTree(File file) throws IOException
3346
3349
* passed-in {@link URL}.
3347
3350
*<p>
3348
3351
* NOTE: handling of {@link java.net.URL} is delegated to
3349
- * {@link JsonFactory#createParser(java.net. URL)} and usually simply
3352
+ * {@link JsonFactory#createParser(URL)} and usually simply
3350
3353
* calls {@link java.net.URL#openStream()}, meaning no special handling
3351
3354
* is done. If different HTTP connection options are needed you will need
3352
3355
* to create {@link java.io.InputStream} separately.
3356
+ *
3357
+ * @deprecated since 2.20 deprecated as it calls {@link JsonFactory#createParser(URL)}.
3353
3358
*/
3359
+ @ Deprecated // @since 2.20
3354
3360
public JsonNode readTree (URL source ) throws IOException
3355
3361
{
3356
3362
_assertNotNull ("source" , source );
@@ -3817,29 +3823,40 @@ public <T> T readValue(File src, JavaType valueType)
3817
3823
* of type {@link JsonParser} supports (JSON for default case)
3818
3824
* @throws DatabindException if the input JSON structure does not match structure
3819
3825
* expected for result type (or has other mismatch issues)
3826
+ *
3827
+ * @deprecated since 2.20 deprecated as it calls {@link JsonFactory#createParser(URL)}.
3820
3828
*/
3829
+ @ Deprecated // @since 2.20
3821
3830
@ SuppressWarnings ("unchecked" )
3822
3831
public <T > T readValue (URL src , Class <T > valueType )
3823
3832
throws IOException , StreamReadException , DatabindException
3824
3833
{
3825
3834
_assertNotNull ("src" , src );
3826
- return (T ) _readMapAndClose (_jsonFactory .createParser (src ), _typeFactory .constructType (valueType ));
3835
+ return (T ) _readMapAndClose (_jsonFactory .createParser (src ),
3836
+ _typeFactory .constructType (valueType ));
3827
3837
}
3828
3838
3829
3839
/**
3830
3840
* Same as {@link #readValue(java.net.URL, Class)} except that target specified by {@link TypeReference}.
3841
+ *
3842
+ * @deprecated since 2.20 deprecated as it calls {@link JsonFactory#createParser(URL)}.
3831
3843
*/
3844
+ @ Deprecated // @since 2.20
3832
3845
@ SuppressWarnings ({ "unchecked" })
3833
3846
public <T > T readValue (URL src , TypeReference <T > valueTypeRef )
3834
3847
throws IOException , StreamReadException , DatabindException
3835
3848
{
3836
3849
_assertNotNull ("src" , src );
3837
- return (T ) _readMapAndClose (_jsonFactory .createParser (src ), _typeFactory .constructType (valueTypeRef ));
3850
+ return (T ) _readMapAndClose (_jsonFactory .createParser (src ),
3851
+ _typeFactory .constructType (valueTypeRef ));
3838
3852
}
3839
3853
3840
3854
/**
3841
3855
* Same as {@link #readValue(java.net.URL, Class)} except that target specified by {@link JavaType}.
3856
+ *
3857
+ * @deprecated since 2.20 deprecated as it calls {@link JsonFactory#createParser(URL)}.
3842
3858
*/
3859
+ @ Deprecated // @since 2.20
3843
3860
@ SuppressWarnings ("unchecked" )
3844
3861
public <T > T readValue (URL src , JavaType valueType )
3845
3862
throws IOException , StreamReadException , DatabindException
0 commit comments