Example usage for android.util JsonToken STRING

List of usage examples for android.util JsonToken STRING

Introduction

In this page you can find the example usage for android.util JsonToken STRING.

Prototype

JsonToken STRING

To view the source code for android.util JsonToken STRING.

Click Source Link

Document

A JSON string.

Usage

From source file:com.workday.autoparse.json.parser.JsonParserUtils.java

public static String nextString(JsonReader reader, String name) throws IOException {
    if (handleNull(reader)) {
        return null;
    }/*w  w  w.j a v  a  2 s.com*/
    assertType(reader, name, JsonToken.STRING, JsonToken.NUMBER, JsonToken.BOOLEAN);

    if (reader.peek() == JsonToken.BOOLEAN) {
        return String.valueOf(reader.nextBoolean());
    }

    return reader.nextString();
}