@Override public Object getRootField(final JsonNode obj, final String key) { return valueConversionFunction(obj.get(key)); }
@Override public Function<JsonNode, Object> makeJsonQueryExtractor(final String expr) { try { final JsonQuery jsonQuery = JsonQuery.compile(expr); return jsonNode -> { try { return valueConversionFunction(jsonQuery.apply(jsonNode).get(0)); } catch (JsonQueryException e) { throw new RuntimeException(e); } }; } catch (JsonQueryException e) { throw new RuntimeException(e); } }
@Override public Function<JsonNode, Object> makeJsonPathExtractor(final String expr) { final JsonPath jsonPath = JsonPath.compile(expr); return node -> valueConversionFunction(jsonPath.read(node, JSONPATH_CONFIGURATION)); }
for (JsonNode entry : val) { if (!entry.isNull()) { newList.add(valueConversionFunction(entry)); for (Iterator<Map.Entry<String, JsonNode>> it = val.fields(); it.hasNext(); ) { Map.Entry<String, JsonNode> entry = it.next(); newMap.put(entry.getKey(), valueConversionFunction(entry.getValue()));
@Override public Object getRootField(final JsonNode obj, final String key) { return valueConversionFunction(obj.get(key)); }
@Override public Function<JsonNode, Object> makeJsonQueryExtractor(final String expr) { try { final JsonQuery jsonQuery = JsonQuery.compile(expr); return jsonNode -> { try { return valueConversionFunction(jsonQuery.apply(jsonNode).get(0)); } catch (JsonQueryException e) { throw new RuntimeException(e); } }; } catch (JsonQueryException e) { throw new RuntimeException(e); } }
@Override public Function<JsonNode, Object> makeJsonPathExtractor(final String expr) { final JsonPath jsonPath = JsonPath.compile(expr); return node -> valueConversionFunction(jsonPath.read(node, JSONPATH_CONFIGURATION)); }
List<Object> newList = new ArrayList<>(); for (JsonNode entry : val) { newList.add(valueConversionFunction(entry)); for (Iterator<Map.Entry<String, JsonNode>> it = val.fields(); it.hasNext(); ) { Map.Entry<String, JsonNode> entry = it.next(); newMap.put(entry.getKey(), valueConversionFunction(entry.getValue()));