MCPcopy
hub / github.com/google/gson / nextName

Method nextName

gson/src/main/java/com/google/gson/stream/JsonReader.java:925–943  ·  view source on GitHub ↗

Returns the next token, a {@link JsonToken#NAME property name}, and consumes it. @throws IllegalStateException if the next token is not a property name.

()

Source from the content-addressed store, hash-verified

923 * @throws IllegalStateException if the next token is not a property name.
924 */
925 public String nextName() throws IOException {
926 int p = peeked;
927 if (p == PEEKED_NONE) {
928 p = doPeek();
929 }
930 String result;
931 if (p == PEEKED_UNQUOTED_NAME) {
932 result = nextUnquotedValue();
933 } else if (p == PEEKED_SINGLE_QUOTED_NAME) {
934 result = nextQuotedValue('\'');
935 } else if (p == PEEKED_DOUBLE_QUOTED_NAME) {
936 result = nextQuotedValue('"');
937 } else {
938 throw unexpectedTokenError("a name");
939 }
940 peeked = PEEKED_NONE;
941 pathNames[stackSize - 1] = result;
942 return result;
943 }
944
945 /**
946 * Returns the {@link JsonToken#STRING string} value of the next token, consuming it. If the next

Callers 15

pathMethod · 0.95
objectPathMethod · 0.95
skipObjectValuesMethod · 0.95
skipObjectEndMethod · 0.95
objectOfObjectsMethod · 0.95
testReadObjectMethod · 0.95
testSkipArrayMethod · 0.95

Calls 4

doPeekMethod · 0.95
nextUnquotedValueMethod · 0.95
nextQuotedValueMethod · 0.95
unexpectedTokenErrorMethod · 0.95

Tested by 15

pathMethod · 0.76
objectPathMethod · 0.76
skipObjectValuesMethod · 0.76
skipObjectEndMethod · 0.76
objectOfObjectsMethod · 0.76
testReadObjectMethod · 0.76
testSkipArrayMethod · 0.76
testSkipObjectMethod · 0.76
testSkipIntegerMethod · 0.76
testSkipDoubleMethod · 0.76