Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

trivers json node as node type2

private void appendNodeToYaml(
  JsonNode node, StringBuilder yaml, int depth, boolean isArrayItem) {
    Iterator<Entry<String, JsonNode>> fields = node.fields();
    boolean isFirst = true;
    while (fields.hasNext()) {
        Entry<String, JsonNode> jsonField = fields.next();
        addFieldNameToYaml(yaml, jsonField.getKey(), depth, isArrayItem && isFirst);
        processNode(jsonField.getValue(), yaml, depth+1);
        isFirst = false;
    }
        
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #trivers #json #node #node
ADD COMMENT
Topic
Name
4+5 =