@@ -1148,6 +1148,14 @@ public <T> T readValue(InputStream in) throws IOException
1148
1148
_considerFilter (_parserFactory .createParser (ctxt , in ), false ));
1149
1149
}
1150
1150
1151
+ /**
1152
+ * Overloading to alert compiler as to the valueType
1153
+ */
1154
+ public <T > T readValue (InputStream src , Class <T > valueType ) throws IOException
1155
+ {
1156
+ return (T ) forType (valueType ).readValue (src );
1157
+ }
1158
+
1151
1159
/**
1152
1160
* Method that binds content read from given input source,
1153
1161
* using configuration of this reader.
@@ -1163,6 +1171,14 @@ public <T> T readValue(Reader r) throws IOException
1163
1171
_considerFilter (_parserFactory .createParser (ctxt , r ), false ));
1164
1172
}
1165
1173
1174
+ /**
1175
+ * Overloading to alert compiler as to the valueType
1176
+ */
1177
+ public <T > T readValue (Reader src , Class <T > valueType ) throws IOException
1178
+ {
1179
+ return (T ) forType (valueType ).readValue (src );
1180
+ }
1181
+
1166
1182
/**
1167
1183
* Method that binds content read from given JSON string,
1168
1184
* using configuration of this reader.
@@ -1178,6 +1194,14 @@ public <T> T readValue(String content) throws IOException
1178
1194
_considerFilter (_parserFactory .createParser (ctxt , content ), false ));
1179
1195
}
1180
1196
1197
+ /**
1198
+ * Overloading to alert compiler as to the valueType
1199
+ */
1200
+ public <T > T readValue (String src , Class <T > valueType ) throws IOException
1201
+ {
1202
+ return (T ) forType (valueType ).readValue (src );
1203
+ }
1204
+
1181
1205
/**
1182
1206
* Method that binds content read from given byte array,
1183
1207
* using configuration of this reader.
@@ -1193,6 +1217,14 @@ public <T> T readValue(byte[] content) throws IOException
1193
1217
_considerFilter (_parserFactory .createParser (ctxt , content ), false ));
1194
1218
}
1195
1219
1220
+ /**
1221
+ * Overloading to alert compiler as to the valueType
1222
+ */
1223
+ public <T > T readValue (byte [] content , Class <T > valueType ) throws IOException
1224
+ {
1225
+ return (T ) forType (valueType ).readValue (content );
1226
+ }
1227
+
1196
1228
/**
1197
1229
* Method that binds content read from given byte array,
1198
1230
* using configuration of this reader.
@@ -1207,7 +1239,15 @@ public <T> T readValue(byte[] content, int offset, int length) throws IOExceptio
1207
1239
return (T ) _bindAndClose (ctxt ,
1208
1240
_considerFilter (_parserFactory .createParser (ctxt , content , offset , length ), false ));
1209
1241
}
1210
-
1242
+
1243
+ /**
1244
+ * Overloading to alert compiler as to the valueType
1245
+ */
1246
+ public <T > T readValue (byte [] content , int offset , int length , Class <T > valueType ) throws IOException
1247
+ {
1248
+ return (T ) forType (valueType ).readValue (content , offset , length );
1249
+ }
1250
+
1211
1251
@ SuppressWarnings ("unchecked" )
1212
1252
public <T > T readValue (File f ) throws IOException
1213
1253
{
@@ -1217,6 +1257,14 @@ public <T> T readValue(File f) throws IOException
1217
1257
_considerFilter (_parserFactory .createParser (ctxt , f ), false ));
1218
1258
}
1219
1259
1260
+ /**
1261
+ * Overloading to alert compiler as to the valueType
1262
+ */
1263
+ public <T > T readValue (File src , Class <T > valueType ) throws IOException
1264
+ {
1265
+ return (T ) forType (valueType ).readValue (src );
1266
+ }
1267
+
1220
1268
/**
1221
1269
* Method that binds content read from given input source,
1222
1270
* using configuration of this reader.
@@ -1239,6 +1287,14 @@ public <T> T readValue(URL url) throws IOException
1239
1287
_considerFilter (_parserFactory .createParser (ctxt , url ), false ));
1240
1288
}
1241
1289
1290
+ /**
1291
+ * Overloading to alert compiler as to the valueType
1292
+ */
1293
+ public <T > T readValue (URL src , Class <T > valueType ) throws IOException
1294
+ {
1295
+ return (T ) forType (valueType ).readValue (src );
1296
+ }
1297
+
1242
1298
/**
1243
1299
* Convenience method for converting results from given JSON tree into given
1244
1300
* value type. Basically short-cut for:
@@ -1255,6 +1311,14 @@ public <T> T readValue(JsonNode node) throws IOException
1255
1311
_considerFilter (treeAsTokens (node , ctxt ), false ));
1256
1312
}
1257
1313
1314
+ /**
1315
+ * Overloading to alert compiler as to the valueType
1316
+ */
1317
+ public <T > T readValue (JsonNode src , Class <T > valueType ) throws IOException
1318
+ {
1319
+ return (T ) forType (valueType ).readValue (src );
1320
+ }
1321
+
1258
1322
@ SuppressWarnings ("unchecked" )
1259
1323
public <T > T readValue (DataInput input ) throws IOException
1260
1324
{
@@ -1264,6 +1328,14 @@ public <T> T readValue(DataInput input) throws IOException
1264
1328
_considerFilter (_parserFactory .createParser (ctxt , input ), false ));
1265
1329
}
1266
1330
1331
+ /**
1332
+ * Overloading to alert compiler as to the valueType
1333
+ */
1334
+ public <T > T readValue (DataInput content , Class <T > valueType ) throws IOException
1335
+ {
1336
+ return (T ) forType (valueType ).readValue (content );
1337
+ }
1338
+
1267
1339
/*
1268
1340
/**********************************************************
1269
1341
/* Deserialization methods; JsonNode ("tree")
0 commit comments