@@ -134,14 +134,14 @@ public BaseNodeDeserializer(Class<T> vc) {
134
134
}
135
135
136
136
@ Override
137
- public Object deserializeWithType (JsonParser jp , DeserializationContext ctxt ,
137
+ public Object deserializeWithType (JsonParser p , DeserializationContext ctxt ,
138
138
TypeDeserializer typeDeserializer )
139
139
throws IOException
140
140
{
141
141
/* Output can be as JSON Object, Array or scalar: no way to know
142
142
* a priori. So:
143
143
*/
144
- return typeDeserializer .deserializeTypedFromAny (jp , ctxt );
144
+ return typeDeserializer .deserializeTypedFromAny (p , ctxt );
145
145
}
146
146
147
147
/* 07-Nov-2014, tatu: When investigating [databind#604], realized that it makes
@@ -157,8 +157,8 @@ public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt,
157
157
/**********************************************************
158
158
*/
159
159
160
- protected void _reportProblem (JsonParser jp , String msg ) throws JsonMappingException {
161
- throw new JsonMappingException (msg , jp .getTokenLocation ());
160
+ protected void _reportProblem (JsonParser p , String msg ) throws JsonMappingException {
161
+ throw new JsonMappingException (msg , p .getTokenLocation ());
162
162
}
163
163
164
164
/**
@@ -187,15 +187,15 @@ protected void _handleDuplicateField(String fieldName, ObjectNode objectNode,
187
187
* was added
188
188
* @param newValue Newly added value just added to the object node
189
189
*/
190
- protected void _handleDuplicateField (JsonParser jp , DeserializationContext ctxt ,
190
+ protected void _handleDuplicateField (JsonParser p , DeserializationContext ctxt ,
191
191
JsonNodeFactory nodeFactory ,
192
192
String fieldName , ObjectNode objectNode ,
193
193
JsonNode oldValue , JsonNode newValue )
194
194
throws JsonProcessingException
195
195
{
196
196
// [Issue#237]: Report an error if asked to do so:
197
197
if (ctxt .isEnabled (DeserializationFeature .FAIL_ON_READING_DUP_TREE_KEY )) {
198
- _reportProblem (jp , "Duplicate field '" +fieldName +"' for ObjectNode: not allowed when FAIL_ON_READING_DUP_TREE_KEY enabled" );
198
+ _reportProblem (p , "Duplicate field '" +fieldName +"' for ObjectNode: not allowed when FAIL_ON_READING_DUP_TREE_KEY enabled" );
199
199
}
200
200
// Backwards-compatibility; call in case it's overloaded
201
201
_handleDuplicateField (fieldName , objectNode , oldValue , newValue );
@@ -207,30 +207,30 @@ protected void _handleDuplicateField(JsonParser jp, DeserializationContext ctxt,
207
207
/**********************************************************
208
208
*/
209
209
210
- protected final ObjectNode deserializeObject (JsonParser jp , DeserializationContext ctxt ,
210
+ protected final ObjectNode deserializeObject (JsonParser p , DeserializationContext ctxt ,
211
211
final JsonNodeFactory nodeFactory ) throws IOException
212
212
{
213
213
ObjectNode node = nodeFactory .objectNode ();
214
- JsonToken t = jp .getCurrentToken ();
214
+ JsonToken t = p .getCurrentToken ();
215
215
if (t == JsonToken .START_OBJECT ) {
216
- t = jp .nextToken ();
216
+ t = p .nextToken ();
217
217
}
218
- for (; t == JsonToken .FIELD_NAME ; t = jp .nextToken ()) {
219
- String fieldName = jp .getCurrentName ();
218
+ for (; t == JsonToken .FIELD_NAME ; t = p .nextToken ()) {
219
+ String fieldName = p .getCurrentName ();
220
220
JsonNode value ;
221
- t = jp .nextToken ();
221
+ t = p .nextToken ();
222
222
switch (t .id ()) {
223
223
case JsonTokenId .ID_START_OBJECT :
224
- value = deserializeObject (jp , ctxt , nodeFactory );
224
+ value = deserializeObject (p , ctxt , nodeFactory );
225
225
break ;
226
226
case JsonTokenId .ID_START_ARRAY :
227
- value = deserializeArray (jp , ctxt , nodeFactory );
227
+ value = deserializeArray (p , ctxt , nodeFactory );
228
228
break ;
229
229
case JsonTokenId .ID_STRING :
230
- value = nodeFactory .textNode (jp .getText ());
230
+ value = nodeFactory .textNode (p .getText ());
231
231
break ;
232
232
case JsonTokenId .ID_NUMBER_INT :
233
- value = _fromInt (jp , ctxt , nodeFactory );
233
+ value = _fromInt (p , ctxt , nodeFactory );
234
234
break ;
235
235
case JsonTokenId .ID_TRUE :
236
236
value = nodeFactory .booleanNode (true );
@@ -242,40 +242,40 @@ protected final ObjectNode deserializeObject(JsonParser jp, DeserializationConte
242
242
value = nodeFactory .nullNode ();
243
243
break ;
244
244
default :
245
- value = deserializeAny (jp , ctxt , nodeFactory );
245
+ value = deserializeAny (p , ctxt , nodeFactory );
246
246
}
247
247
JsonNode old = node .replace (fieldName , value );
248
248
if (old != null ) {
249
- _handleDuplicateField (jp , ctxt , nodeFactory ,
249
+ _handleDuplicateField (p , ctxt , nodeFactory ,
250
250
fieldName , node , old , value );
251
251
}
252
252
}
253
253
return node ;
254
254
}
255
255
256
- protected final ArrayNode deserializeArray (JsonParser jp , DeserializationContext ctxt ,
256
+ protected final ArrayNode deserializeArray (JsonParser p , DeserializationContext ctxt ,
257
257
final JsonNodeFactory nodeFactory ) throws IOException
258
258
{
259
259
ArrayNode node = nodeFactory .arrayNode ();
260
260
while (true ) {
261
- JsonToken t = jp .nextToken ();
261
+ JsonToken t = p .nextToken ();
262
262
if (t == null ) {
263
263
throw ctxt .mappingException ("Unexpected end-of-input when binding data into ArrayNode" );
264
264
}
265
265
switch (t .id ()) {
266
266
case JsonTokenId .ID_START_OBJECT :
267
- node .add (deserializeObject (jp , ctxt , nodeFactory ));
267
+ node .add (deserializeObject (p , ctxt , nodeFactory ));
268
268
break ;
269
269
case JsonTokenId .ID_START_ARRAY :
270
- node .add (deserializeArray (jp , ctxt , nodeFactory ));
270
+ node .add (deserializeArray (p , ctxt , nodeFactory ));
271
271
break ;
272
272
case JsonTokenId .ID_END_ARRAY :
273
273
return node ;
274
274
case JsonTokenId .ID_STRING :
275
- node .add (nodeFactory .textNode (jp .getText ()));
275
+ node .add (nodeFactory .textNode (p .getText ()));
276
276
break ;
277
277
case JsonTokenId .ID_NUMBER_INT :
278
- node .add (_fromInt (jp , ctxt , nodeFactory ));
278
+ node .add (_fromInt (p , ctxt , nodeFactory ));
279
279
break ;
280
280
case JsonTokenId .ID_TRUE :
281
281
node .add (nodeFactory .booleanNode (true ));
@@ -287,31 +287,31 @@ protected final ArrayNode deserializeArray(JsonParser jp, DeserializationContext
287
287
node .add (nodeFactory .nullNode ());
288
288
break ;
289
289
default :
290
- node .add (deserializeAny (jp , ctxt , nodeFactory ));
290
+ node .add (deserializeAny (p , ctxt , nodeFactory ));
291
291
break ;
292
292
}
293
293
}
294
294
}
295
295
296
- protected final JsonNode deserializeAny (JsonParser jp , DeserializationContext ctxt ,
296
+ protected final JsonNode deserializeAny (JsonParser p , DeserializationContext ctxt ,
297
297
final JsonNodeFactory nodeFactory ) throws IOException
298
298
{
299
- switch (jp .getCurrentTokenId ()) {
299
+ switch (p .getCurrentTokenId ()) {
300
300
case JsonTokenId .ID_START_OBJECT :
301
301
case JsonTokenId .ID_END_OBJECT : // for empty JSON Objects we may point to this
302
- return deserializeObject (jp , ctxt , nodeFactory );
302
+ return deserializeObject (p , ctxt , nodeFactory );
303
303
case JsonTokenId .ID_START_ARRAY :
304
- return deserializeArray (jp , ctxt , nodeFactory );
304
+ return deserializeArray (p , ctxt , nodeFactory );
305
305
case JsonTokenId .ID_FIELD_NAME :
306
- return deserializeObject (jp , ctxt , nodeFactory );
306
+ return deserializeObject (p , ctxt , nodeFactory );
307
307
case JsonTokenId .ID_EMBEDDED_OBJECT :
308
- return _fromEmbedded (jp , ctxt , nodeFactory );
308
+ return _fromEmbedded (p , ctxt , nodeFactory );
309
309
case JsonTokenId .ID_STRING :
310
- return nodeFactory .textNode (jp .getText ());
310
+ return nodeFactory .textNode (p .getText ());
311
311
case JsonTokenId .ID_NUMBER_INT :
312
- return _fromInt (jp , ctxt , nodeFactory );
312
+ return _fromInt (p , ctxt , nodeFactory );
313
313
case JsonTokenId .ID_NUMBER_FLOAT :
314
- return _fromFloat (jp , ctxt , nodeFactory );
314
+ return _fromFloat (p , ctxt , nodeFactory );
315
315
case JsonTokenId .ID_TRUE :
316
316
return nodeFactory .booleanNode (true );
317
317
case JsonTokenId .ID_FALSE :
@@ -329,36 +329,36 @@ protected final JsonNode deserializeAny(JsonParser jp, DeserializationContext ct
329
329
}
330
330
}
331
331
332
- protected final JsonNode _fromInt (JsonParser jp , DeserializationContext ctxt ,
332
+ protected final JsonNode _fromInt (JsonParser p , DeserializationContext ctxt ,
333
333
JsonNodeFactory nodeFactory ) throws IOException
334
334
{
335
- JsonParser .NumberType nt = jp .getNumberType ();
335
+ JsonParser .NumberType nt = p .getNumberType ();
336
336
if (nt == JsonParser .NumberType .BIG_INTEGER
337
337
|| ctxt .isEnabled (DeserializationFeature .USE_BIG_INTEGER_FOR_INTS )) {
338
- return nodeFactory .numberNode (jp .getBigIntegerValue ());
338
+ return nodeFactory .numberNode (p .getBigIntegerValue ());
339
339
}
340
340
if (nt == JsonParser .NumberType .INT ) {
341
- return nodeFactory .numberNode (jp .getIntValue ());
341
+ return nodeFactory .numberNode (p .getIntValue ());
342
342
}
343
- return nodeFactory .numberNode (jp .getLongValue ());
343
+ return nodeFactory .numberNode (p .getLongValue ());
344
344
}
345
345
346
- protected final JsonNode _fromFloat (JsonParser jp , DeserializationContext ctxt ,
346
+ protected final JsonNode _fromFloat (JsonParser p , DeserializationContext ctxt ,
347
347
final JsonNodeFactory nodeFactory ) throws IOException
348
348
{
349
- JsonParser .NumberType nt = jp .getNumberType ();
349
+ JsonParser .NumberType nt = p .getNumberType ();
350
350
if (nt == JsonParser .NumberType .BIG_DECIMAL
351
351
|| ctxt .isEnabled (DeserializationFeature .USE_BIG_DECIMAL_FOR_FLOATS )) {
352
- return nodeFactory .numberNode (jp .getDecimalValue ());
352
+ return nodeFactory .numberNode (p .getDecimalValue ());
353
353
}
354
- return nodeFactory .numberNode (jp .getDoubleValue ());
354
+ return nodeFactory .numberNode (p .getDoubleValue ());
355
355
}
356
356
357
- protected final JsonNode _fromEmbedded (JsonParser jp , DeserializationContext ctxt ,
357
+ protected final JsonNode _fromEmbedded (JsonParser p , DeserializationContext ctxt ,
358
358
JsonNodeFactory nodeFactory ) throws IOException
359
359
{
360
360
// [JACKSON-796]
361
- Object ob = jp .getEmbeddedObject ();
361
+ Object ob = p .getEmbeddedObject ();
362
362
if (ob == null ) { // should this occur?
363
363
return nodeFactory .nullNode ();
364
364
}
0 commit comments