Examples of arrayNode()


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

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

        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

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

    @Test
    public void pathCanReferToArrayContentsByIndex() {

        ObjectNode root = new ObjectMapper().createObjectNode();

        ArrayNode a = root.arrayNode();
        root.put("a", a);

        a.add(root.objectNode());
        a.add(root.objectNode());
        a.add(root.objectNode());
View Full Code Here

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

    @Test(expected = IllegalArgumentException.class)
    public void attemptToUsePropertyNameOnArrayNodeThrowsIllegalArgumentException() {

        ObjectNode root = new ObjectMapper().createObjectNode();

        ArrayNode a = root.arrayNode();
        root.put("a", a);

        resolver.resolve(root, "#/a/b");

    }
View Full Code Here

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

        rootNode.put("@context", "http://library.stanford.edu/iiif/image-api/1.1/context.json");
        rootNode.put("@id", aService + "/" + aPrefix + "/" + id);
        rootNode.put("width", getWidth());
        rootNode.put("height", getHeight());

        scaleFactors = rootNode.arrayNode();

        for (int index = 0; index < myLevel; index++) {
            scaleFactors.add(index + 1);
        }
View Full Code Here

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

        rootNode.put("scale_factors", scaleFactors);
        rootNode.put("tile_width", 256); // TODO: provide other tile size options?
        rootNode.put("tile_height", 256);

        formats = rootNode.arrayNode();

        for (final String format : getFormats()) {
            formats.add(format);
        }
View Full Code Here

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

        for (final String format : getFormats()) {
            formats.add(format);
        }

        rootNode.put("formats", formats);
        rootNode.put("qualities", rootNode.arrayNode().add("native"));
        rootNode.put("profile", Constants.IIIF_URL + "1.1/compliance.html#level1");

        return mapper.writeValueAsString(rootNode);
    }
View Full Code Here

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

      requestNode.put("candidateGroup", "sales");
      assertResultsPresentInPostDataResponse(url, requestNode, processTask.getId());

      // Candidate group In filtering
      requestNode.removeAll();
      ArrayNode arrayNode =  requestNode.arrayNode();
     
      arrayNode.add("sales");
      arrayNode.add("someOtherGroup");
     
      requestNode.put("candidateGroupIn", arrayNode);
View Full Code Here

Examples of org.codehaus.jackson.node.ObjectNode.arrayNode()

  /** {@inheritDoc} */
  @Override
  protected JsonNode toJsonNode() {
    final ObjectNode root = JsonNodeFactory.instance.objectNode();
    root.put(OPERATOR_NODE, mOperator.name());
    final ArrayNode filters = root.arrayNode();
    for (KijiRowFilter filter : mFilters) {
      if (filter != null) {
        filters.add(filter.toJson());
      }
    }
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.