MCPcopy Create free account
hub / github.com/amazon-ion/ion-java / oneValue

Method oneValue

src/test/java/com/amazon/ion/IonTestCase.java:469–490  ·  view source on GitHub ↗

Parses text as a single Ion value. If the text contains more than that, a failure is thrown. @param text must not be null . @return a single value, not null .

(String text)

Source from the content-addressed store, hash-verified

467 * @return a single value, not <code>null</code>.
468 */
469 public IonValue oneValue(String text)
470 {
471 IonValue value = null;
472
473 Iterator<IonValue> iterator = system().iterate(text);
474 if (iterator.hasNext())
475 {
476 value = iterator.next();
477
478 if (iterator.hasNext())
479 {
480 IonValue part = iterator.next();
481 fail("Found unexpected part <" + part + "> in text: " + text);
482 }
483 }
484 else
485 {
486 fail("No data found in text: " + text);
487 }
488
489 return value;
490 }
491
492
493 public IonDecimal decimal(String text)

Callers 15

decimalMethod · 0.95
oneSexpMethod · 0.95
structMethod · 0.95
badValueMethod · 0.95
assertEscapeMethod · 0.95
testTextNullStringMethod · 0.45
testEmptyStringsMethod · 0.45
testStringBasicsMethod · 0.45
testTruncatedStringsMethod · 0.45
testBackslashEofMethod · 0.45
testStringEscapesMethod · 0.45
testOctal000Method · 0.45

Calls 5

systemMethod · 0.95
failMethod · 0.80
iterateMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected