@Override public ObjectNode findParent(String fieldName) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
/** * Parses the given JsonNode which is a <code>@context</code> node and find * the type coercion terms. * * @param contextJsonNode * @return the name of the type coercion term keys otherwise empty * <code>List<String></code> * @review */ public static List<String> getTypeCoercionTermKeys( JsonNode contextJsonNode) { List<String> typeCoercionTermKeys = new ArrayList<>(); for (JsonNode jsonNode : contextJsonNode) { if (jsonNode.isObject()) { JsonNode typeObjectJsonNode = jsonNode.findParent( JSONLDConstants.TYPE); if (typeObjectJsonNode != null) { JsonNode typeJsonNode = typeObjectJsonNode.path( JSONLDConstants.TYPE); if (JSONLDConstants.ID.equals(typeJsonNode.asText())) { Iterator<String> it = jsonNode.fieldNames(); while (it.hasNext()) { typeCoercionTermKeys.add(it.next()); } } } } } return typeCoercionTermKeys; }
@Override public ObjectNode findParent(String fieldName) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } return null; }
@Override public ObjectNode findParent(String fieldName) { if (_children != null) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } } return null; }
@Override public ObjectNode findParent(String fieldName) { if (_children != null) { for (JsonNode node : _children) { JsonNode parent = node.findParent(fieldName); if (parent != null) { return (ObjectNode) parent; } } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
@Override public ObjectNode findParent(String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
@Override public ObjectNode findParent(String fieldName) { if (_children != null) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } } return null; }
@Override public ObjectNode findParent(String fieldName) { if (_children != null) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (fieldName.equals(entry.getKey())) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } } return null; }
/** * {@inheritDoc} */ @Override public ObjectNode findParent(final String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (toLowerCase(fieldName).equals(toLowerCase(entry.getKey()))) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
/** * {@inheritDoc} */ @Override public ObjectNode findParent(final String fieldName) { for (Map.Entry<String, JsonNode> entry : _children.entrySet()) { if (toLowerCase(fieldName).equals(toLowerCase(entry.getKey()))) { return this; } JsonNode value = entry.getValue().findParent(fieldName); if (value != null) { return (ObjectNode) value; } } return null; }
continue; } else if (name.equals(Path.PARENT)) { output = node.findParent(p.head(findNextNonRealtiveSegment(p, l))); continue; } else if (output instanceof ArrayNode) {
JSONAssert.assertEquals(expAftrPut, jh.get().get("document-content").findParent("array").toString(), false); JSONAssert.assertEquals(expectedResponse, tjs.deleteJSON("helloJS" + j + ".json"), false);