MCPcopy Index your code
hub / github.com/benfry/processing4 / nextValue

Method nextValue

core/src/processing/data/JSONTokener.java:352–389  ·  view source on GitHub ↗

Get the next value. The value can be a Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object. @throws JSONException If syntax error. @return An object.

()

Source from the content-addressed store, hash-verified

350 * @return An object.
351 */
352 public Object nextValue() {
353 char c = this.nextClean();
354 String string;
355
356 switch (c) {
357 case '"':
358 case '\'':
359 return this.nextString(c);
360 case '{':
361 this.back();
362 return new JSONObject(this);
363 case '[':
364 this.back();
365 return new JSONArray(this);
366 }
367
368 /*
369 * Handle unquoted text. This could be the values true, false, or
370 * null, or it can be a number. An implementation (such as this one)
371 * is allowed to also accept non-standard forms.
372 *
373 * Accumulate characters until we reach the end of the text or a
374 * formatting character.
375 */
376
377 StringBuilder sb = new StringBuilder();
378 while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
379 sb.append(c);
380 c = this.next();
381 }
382 this.back();
383
384 string = sb.toString().trim();
385 if ("".equals(string)) {
386 throw new RuntimeException("Missing value");
387 }
388 return JSONObject.stringToValue(string);
389 }
390
391
392 /**

Callers 2

JSONArrayMethod · 0.80
JSONObjectMethod · 0.80

Calls 9

nextCleanMethod · 0.95
nextStringMethod · 0.95
backMethod · 0.95
nextMethod · 0.95
stringToValueMethod · 0.95
appendMethod · 0.45
trimMethod · 0.45
toStringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected