public <T> List<T> nextList(boolean optional, ListReader<T> listReader) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { List<T> result = new ArrayList<>(); jsonReader.beginArray(); while (jsonReader.hasNext()) { T item = listReader.read(this); result.add(item); } jsonReader.endArray(); return result; } }
public <T> T nextObject(boolean optional, ObjectReader<T> objectReader) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { jsonReader.beginObject(); T result = objectReader.read(this); jsonReader.endObject(); return result; } }
public Boolean nextBoolean(boolean optional) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { return jsonReader.nextBoolean(); } }
public Double nextDouble(boolean optional) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { return jsonReader.nextDouble(); } }
public boolean hasNext() throws IOException { return jsonReader.hasNext(); }
public String nextName() throws IOException { return jsonReader.nextName(); }
public Double nextDouble(boolean optional) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { return jsonReader.nextDouble(); } }
public boolean hasNext() throws IOException { return jsonReader.hasNext(); }
public String nextName() throws IOException { return jsonReader.nextName(); }
public <T> List<T> nextList(boolean optional, ListReader<T> listReader) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { List<T> result = new ArrayList<>(); jsonReader.beginArray(); while (jsonReader.hasNext()) { T item = listReader.read(this); result.add(item); } jsonReader.endArray(); return result; } }
public <T> T nextObject(boolean optional, ObjectReader<T> objectReader) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { jsonReader.beginObject(); T result = objectReader.read(this); jsonReader.endObject(); return result; } }
public Double nextDouble(boolean optional) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { return jsonReader.nextDouble(); } }
public Boolean nextBoolean(boolean optional) throws IOException { checkNextValue(optional); if (jsonReader.peek() == JsonReader.Token.NULL) { jsonReader.skipValue(); return null; } else { return jsonReader.nextBoolean(); } }
public boolean hasNext() throws IOException { return jsonReader.hasNext(); }