nextString() — spring-boot Function Reference
Architecture documentation for the nextString() function in JSONTokener.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 0e60597a_7663_531a_8d22_7804181f0d6d["nextString()"] e00d01c8_1ae8_f530_0266_0863c164a433["nextValue()"] e00d01c8_1ae8_f530_0266_0863c164a433 -->|calls| 0e60597a_7663_531a_8d22_7804181f0d6d 32ce647b_6cc4_7a2d_0457_3d0f5edfa718["toString()"] 0e60597a_7663_531a_8d22_7804181f0d6d -->|calls| 32ce647b_6cc4_7a2d_0457_3d0f5edfa718 424682c6_51c3_cdab_a5b5_25e0f9a6d8eb["syntaxError()"] 0e60597a_7663_531a_8d22_7804181f0d6d -->|calls| 424682c6_51c3_cdab_a5b5_25e0f9a6d8eb 86045145_3d09_a1ca_b6ad_828ea04afb9d["readEscapeCharacter()"] 0e60597a_7663_531a_8d22_7804181f0d6d -->|calls| 86045145_3d09_a1ca_b6ad_828ea04afb9d style 0e60597a_7663_531a_8d22_7804181f0d6d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
configuration-metadata/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONTokener.java lines 187–225
public String nextString(char quote) throws JSONException {
/*
* For strings that are free of escape sequences, we can just extract the result
* as a substring of the input. But if we encounter an escape sequence, we need to
* use a StringBuilder to compose the result.
*/
StringBuilder builder = null;
/* the index of the first character not yet appended to the builder. */
int start = this.pos;
while (this.pos < this.in.length()) {
int c = this.in.charAt(this.pos++);
if (c == quote) {
if (builder == null) {
// a new string avoids leaking memory
return new String(this.in.substring(start, this.pos - 1));
}
else {
builder.append(this.in, start, this.pos - 1);
return builder.toString();
}
}
if (c == '\\') {
if (this.pos == this.in.length()) {
throw syntaxError("Unterminated escape sequence");
}
if (builder == null) {
builder = new StringBuilder();
}
builder.append(this.in, start, this.pos - 1);
builder.append(readEscapeCharacter());
start = this.pos;
}
}
throw syntaxError("Unterminated string");
}
Domain
Subdomains
Calls
- readEscapeCharacter()
- syntaxError()
- toString()
Called By
Source
Frequently Asked Questions
What does nextString() do?
nextString() is a function in the spring-boot codebase.
What does nextString() call?
nextString() calls 3 function(s): readEscapeCharacter, syntaxError, toString.
What calls nextString()?
nextString() is called by 1 function(s): nextValue.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free