Package com.fasterxml.jackson.databind.node

Examples of com.fasterxml.jackson.databind.node.JsonNodeFactory.arrayNode()


        // lets create a new config
        JsonNodeFactory factory = createNodeFactory();
        ObjectNode config = factory.objectNode();
        config.set("apiVersion", factory.textNode("v1beta1"));
        config.set("kind", factory.textNode("Config"));
        config.set("items", factory.arrayNode());
        return config;
    }

    /**
     * Converts the DTO to a JsonNode
View Full Code Here


        JsonNodeFactory factory = JsonNodeFactory.instance;
        ObjectNode node = factory.objectNode();
        for (Property property : data) {
            if (property.hasArray()) {
                List<Value> arrValue = property.getArray();
                ArrayNode arr = factory.arrayNode();
                arr.addAll(arrValue.stream().map(Value::asJson).collect(Collectors.toList()));
                node.set(property.getName(), arr);
            }
            else if (property.hasObject()) {
                ObjectNode object = factory.objectNode();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.