Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

trivers json node as node type

private void processNode(JsonNode jsonNode, StringBuilder yaml, int depth) {
    if (jsonNode.isValueNode()) {
        yaml.append(jsonNode.asText());
    }
    else if (jsonNode.isArray()) {
        for (JsonNode arrayItem : jsonNode) {
            appendNodeToYaml(arrayItem, yaml, depth, true);
        }
    }
    else if (jsonNode.isObject()) {
        appendNodeToYaml(jsonNode, yaml, depth, false);
    }
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #trivers #json #node #node #type
ADD COMMENT
Topic
Name
4+8 =