@Override protected JsonNode _at(JsonPointer ptr) { return get(ptr.getMatchingIndex()); }
@Override protected JsonNode _at(JsonPointer ptr) { return get(ptr.getMatchingIndex()); }
@Override protected JsonNode _at(JsonPointer ptr) { return get(ptr.getMatchingIndex()); }
@Override protected JsonNode _at(JsonPointer ptr) { return get(ptr.getMatchingIndex()); }
@Override protected JsonNode _at(JsonPointer ptr) { return get(ptr.getMatchingIndex()); }
@Override protected JsonOverlay<?> _findInternal(JsonPointer path) { int index = path.getMatchingIndex(); return index >= 0 && overlays.size() > index ? overlays.get(index)._find(path.tail()) : null; }
/** * Build a JsonNode tree to contain the given value at the given JsonPointer * path. Empty array and object nodes are created and nested as needed. * * @param p a JsonPointer indicating where the value is to appear in the * resulting structure * @param value the value to embed in the structure * @return the created structure */ private JsonNode buildTree(JsonPointer p, JsonNode value) { if (p.matches()) { return value; } else if (p.getMatchingIndex() >= 0) { ArrayNode result = JsonNodeFactory.instance.arrayNode(); result.set(p.getMatchingIndex(), buildTree(p.tail(), value)); return result; } else { ObjectNode result = JsonNodeFactory.instance.objectNode(); result.set(p.getMatchingProperty(), buildTree(p.tail(), value)); return result; } }
try { while (!p.matches()) { int i = p.getMatchingIndex(); if (i >= 0) { if (p.tail().matches() || !tree.has(i)) {