@Test public void testParseGroup20() throws Exception { final Group20Entry group20Entry = parser.parseGroups20(new ClassPathResource("multiple-groups20.json").getInputStream()); assertEquals(3, group20Entry.getEntry().size()); }
public Group20Entry parseGroups20(InputStream in) { Group20Entry result; try { String json = IOUtils.toString(in); InputStream stream = new ByteArrayInputStream(json.getBytes()); final JsonNode jsonNodes = objectMapper.readTree(json); if (jsonNodes.has("result")) { result = parseGroup20ResultWrapper(stream).getResult(); } else if (jsonNodes.has("entry")) { result = (Group20Entry) parse(stream, Group20Entry.class); } else { throw new RuntimeException("Unrecognized JSON " + json); } } catch (IOException e) { throw new RuntimeException(e); } return result; }
OpenConextJsonParser { public Group20Entry parseGroups20(InputStream in) { Group20Entry result; try { String json = IOUtils.toString(in); InputStream stream = new ByteArrayInputStream(json.getBytes()); final JsonNode jsonNodes = objectMapper.readTree(json); if (jsonNodes.has("result")) { result = parseGroup20ResultWrapper(stream).getResult(); } else if (jsonNodes.has("entry")) { result = (Group20Entry) parse(stream, Group20Entry.class); } else { throw new RuntimeException("Unrecognized JSON " + json); } } catch (IOException e) { throw new RuntimeException(e); } return result; } }
OpenConextJsonParser { public Group20Entry parseGroups20(InputStream in) { Group20Entry result; try { String json = IOUtils.toString(in); InputStream stream = new ByteArrayInputStream(json.getBytes()); final JsonNode jsonNodes = objectMapper.readTree(json); if (jsonNodes.has("result")) { result = parseGroup20ResultWrapper(stream).getResult(); } else if (jsonNodes.has("entry")) { result = (Group20Entry) parse(stream, Group20Entry.class); } else { throw new RuntimeException("Unrecognized JSON " + json); } } catch (IOException e) { throw new RuntimeException(e); } return result; } OpenConextJsonParser(); }
OpenConextJsonParser { public Group20Entry parseGroups20(InputStream in) { Group20Entry result; try { String json = IOUtils.toString(in); InputStream stream = new ByteArrayInputStream(json.getBytes()); final JsonNode jsonNodes = objectMapper.readTree(json); if (jsonNodes.has("result")) { result = parseGroup20ResultWrapper(stream).getResult(); } else if (jsonNodes.has("entry")) { result = (Group20Entry) parse(stream, Group20Entry.class); } else { throw new RuntimeException("Unrecognized JSON " + json); } } catch (IOException e) { throw new RuntimeException(e); } return result; } OpenConextJsonParser(); GroupMembersEntry parseTeamMembers(InputStream in); PersonEntry parsePerson(InputStream in); GroupEntry parseGroups(InputStream in); Group20Entry parseGroups20(InputStream in); ObjectMapper getObjectMapper(); void setObjectMapper(ObjectMapper objectMapper); }
OpenConextJsonParser { public Group20Entry parseGroups20(InputStream in) { Group20Entry result; try { String json = IOUtils.toString(in); InputStream stream = new ByteArrayInputStream(json.getBytes()); final JsonNode jsonNodes = objectMapper.readTree(json); if (jsonNodes.has("result")) { result = parseGroup20ResultWrapper(stream).getResult(); } else if (jsonNodes.has("entry")) { result = (Group20Entry) parse(stream, Group20Entry.class); } else { throw new RuntimeException("Unrecognized JSON " + json); } } catch (IOException e) { throw new RuntimeException(e); } return result; } OpenConextJsonParser(); GroupMembersEntry parseTeamMembers(InputStream in); PersonEntry parsePerson(InputStream in); GroupEntry parseGroups(InputStream in); Group20Entry parseGroups20(InputStream in); ObjectMapper getObjectMapper(); void setObjectMapper(ObjectMapper objectMapper);  }