@Override public Object read(ResponseJsonStreamReader reader) throws IOException { if (streamReader.isNextList()) { return readList(reader); } else if (streamReader.isNextObject()) { return readObject(reader); } else { return reader.nextScalar(true); } } });
public Map<String, Object> toMap() throws IOException { if (isNextObject()) { return readObject(this); } Map<String, Object> result = new LinkedHashMap<>(); while (hasNext()) { String name = nextName(); if (isNextNull()) { skipNext(); result.put(name, null); } else if (isNextObject()) { result.put(name, readObject(this)); } else if (isNextList()) { result.put(name, readList(this)); } else { result.put(name, nextScalar(true)); } } return result; }
public Map<String, Object> toMap() throws IOException { if (isNextObject()) { return readObject(this); } Map<String, Object> result = new LinkedHashMap<>(); while (hasNext()) { String name = nextName(); if (isNextNull()) { skipNext(); result.put(name, null); } else if (isNextObject()) { result.put(name, readObject(this)); } else if (isNextList()) { result.put(name, readList(this)); } else { result.put(name, nextScalar(true)); } } return result; }
public Map<String, Object> toMap() throws IOException { if (isNextObject()) { return readObject(this); } Map<String, Object> result = new LinkedHashMap<>(); while (hasNext()) { String name = nextName(); if (isNextNull()) { skipNext(); result.put(name, null); } else if (isNextObject()) { result.put(name, readObject(this)); } else if (isNextList()) { result.put(name, readList(this)); } else { result.put(name, nextScalar(true)); } } return result; }