/**
* Method called to create a new context for iterating all
* contents of the current structured value (JSON array or object)
*/
public final NodeCursor iterateChildren() {
JsonNode n = currentNode();
if (n == null) throw new IllegalStateException("No current node");
if (n.isArray()) { // false since we have already returned START_ARRAY
return new Array(n, this);
}
if (n.isObject()) {
return new Object(n, this);
}
throw new IllegalStateException("Current node of type "+n.getClass().getName());
}