@Test public void hasChildren_TextNode() throws IOException { String jsonString = "{\"text\":\"value\"}"; JsonNode node = JsonUtils.json(jsonString); JsonNodeCursor c = new JsonNodeCursor(new Path(""), node); Assert.assertTrue(c.firstChild()); Assert.assertNotNull(c.getCurrentNode()); Assert.assertTrue(c.getCurrentNode() instanceof TextNode); Assert.assertEquals("text", c.getCurrentPath().toString()); Assert.assertFalse(c.hasChildren(c.getCurrentNode())); }
@Override protected boolean hasChildren(JsonNode node) { return node.isContainerNode() && node.size() > 0; }
JsonNodeCursor extends AbstractTreeCursor<JsonNode> { @Override protected boolean hasChildren(JsonNode node) { return node.isContainerNode() && node.size() > 0; } }
JsonNodeCursor extends AbstractTreeCursor<JsonNode> { @Override protected boolean hasChildren(JsonNode node) { return node.isContainerNode() && node.size() > 0; } JsonNodeCursor(Path p, JsonNode start); }
JsonNodeCursor extends AbstractTreeCursor<JsonNode> { @Override protected boolean hasChildren(JsonNode node) { return node.isContainerNode() && node.size() > 0; } JsonNodeCursor(Path p, JsonNode start);  }
JsonNodeCursor extends AbstractTreeCursor<JsonNode> { @Override protected boolean hasChildren(JsonNode node) { return node.isContainerNode() && node.size() > 0; } JsonNodeCursor(Path p, JsonNode start);   }