MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / readString

Method readString

java/src/org/openqa/selenium/json/JsonInput.java:573–592  ·  view source on GitHub ↗

Read the next element from the JSON input stream as a string, converting escaped characters. @return String object @throws JsonException if input stream ends without finding a closing quote @throws UncheckedIOException if an I/O exception is encountered

()

Source from the content-addressed store, hash-verified

571 * @throws UncheckedIOException if an I/O exception is encountered
572 */
573 private String readString() {
574 input.read(); // Skip leading quote
575
576 StringBuilder builder = new StringBuilder();
577 char c;
578 while (true) {
579 c = input.read();
580 switch (c) {
581 case Input.EOF:
582 throw new JsonException("Unterminated string: " + builder + ". " + input);
583 case '"': // terminate string
584 return builder.toString();
585 case '\\': // quoted char
586 readEscape(builder);
587 break;
588 default:
589 builder.append(c);
590 }
591 }
592 }
593
594 /**
595 * Convert the escape sequence at the current JSON input stream position, appending the result to

Callers 4

nextNameMethod · 0.95
nextStringMethod · 0.95
executeMethod · 0.80

Calls 4

readEscapeMethod · 0.95
readMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45

Tested by 2

executeMethod · 0.64