Lines Matching refs:token

33  * Within JSON objects, name/value pairs are represented by a single token.
193 * long as the longest token that can be reported as a number.
211 * The type of the next token to be returned by {@link #peek} and {@link
214 private JsonToken token;
273 * Consumes the next token from the JSON stream and asserts that it is the
281 * Consumes the next token from the JSON stream and asserts that it is the
289 * Consumes the next token from the JSON stream and asserts that it is the
297 * Consumes the next token from the JSON stream and asserts that it is the
309 if (token != expected) {
320 return token != JsonToken.END_OBJECT && token != JsonToken.END_ARRAY;
324 * Returns the type of the next token without consuming it.
327 if (token != null) {
328 return token;
335 if (!lenient && token != JsonToken.BEGIN_ARRAY && token != JsonToken.BEGIN_OBJECT) {
337 "Expected JSON document to start with '[' or '{' but was " + token);
352 JsonToken token = nextValue();
354 return token;
358 return token = JsonToken.END_DOCUMENT; // TODO: avoid throwing here?
368 * Advances the cursor in the JSON stream to the next token.
373 JsonToken result = token;
374 token = null;
381 * Returns the next token, a {@link JsonToken#NAME property name}, and
384 * @throws IOException if the next token in the stream is not a property
389 if (token != JsonToken.NAME) {
398 * Returns the {@link JsonToken#STRING string} value of the next token,
399 * consuming it. If the next token is a number, this method will return its
402 * @throws IllegalStateException if the next token is not a string or if
407 if (token != JsonToken.STRING && token != JsonToken.NUMBER) {
417 * Returns the {@link JsonToken#BOOLEAN boolean} value of the next token,
420 * @throws IllegalStateException if the next token is not a boolean or if
425 if (token != JsonToken.BOOLEAN) {
426 throw new IllegalStateException("Expected a boolean but was " + token);
435 * Consumes the next token from the JSON stream and asserts that it is a
438 * @throws IllegalStateException if the next token is not null or if this
443 if (token != JsonToken.NULL) {
444 throw new IllegalStateException("Expected null but was " + token);
451 * Returns the {@link JsonToken#NUMBER double} value of the next token,
452 * consuming it. If the next token is a string, this method will attempt to
455 * @throws IllegalStateException if the next token is not a literal value.
459 if (token != JsonToken.STRING && token != JsonToken.NUMBER) {
460 throw new IllegalStateException("Expected a double but was " + token);
469 * Returns the {@link JsonToken#NUMBER long} value of the next token,
470 * consuming it. If the next token is a string, this method will attempt to
471 * parse it as a long. If the next token's numeric value cannot be exactly
474 * @throws IllegalStateException if the next token is not a literal value.
480 if (token != JsonToken.STRING && token != JsonToken.NUMBER) {
481 throw new IllegalStateException("Expected a long but was " + token);
500 * Returns the {@link JsonToken#NUMBER int} value of the next token,
501 * consuming it. If the next token is a string, this method will attempt to
502 * parse it as an int. If the next token's numeric value cannot be exactly
505 * @throws IllegalStateException if the next token is not a literal value.
511 if (token != JsonToken.STRING && token != JsonToken.NUMBER) {
512 throw new IllegalStateException("Expected an int but was " + token);
535 token = null;
543 * elements are skipped. This method is intended for use when the JSON token
554 JsonToken token = advance();
555 if (token == JsonToken.BEGIN_ARRAY || token == JsonToken.BEGIN_OBJECT) {
557 } else if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {
593 return token = JsonToken.END_ARRAY;
607 return token = JsonToken.END_ARRAY;
616 return token = JsonToken.NULL;
634 return token = JsonToken.END_OBJECT;
642 return token = JsonToken.END_OBJECT;
669 return token = JsonToken.NAME;
699 return token = JsonToken.BEGIN_OBJECT;
703 return token = JsonToken.BEGIN_ARRAY;
709 return token = JsonToken.STRING;
1058 token = decodeLiteral();
1059 if (token == JsonToken.STRING) {
1062 return token;