Example usage for android.util JsonToken BOOLEAN

List of usage examples for android.util JsonToken BOOLEAN

Introduction

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

Prototype

JsonToken BOOLEAN

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

Click Source Link

Document

A JSON true or false .

Usage

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

public static Boolean nextBoolean(JsonReader reader, String name) throws IOException {
    if (handleNull(reader)) {
        return false;
    }/*from   w  w w .j  av a2s  .com*/
    assertType(reader, name, JsonToken.BOOLEAN);
    return reader.nextBoolean();
}

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;
    }/*from   www  .  j  av  a  2 s .  c  o  m*/
    assertType(reader, name, JsonToken.STRING, JsonToken.NUMBER, JsonToken.BOOLEAN);

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

    return reader.nextString();
}