Package com.google.json.serialization

Examples of com.google.json.serialization.JsonValue.asArray()


      preOrderVisitor.visit(node);
    }

    JsonValue childNode = node.get("children");
    if (childNode != JsonValue.NULL) {
      JsonArray children = childNode.asArray();

      for (int i = 0, n = children.getLength(); i < n; i++) {
        traverseImpl(children.get(i).asObject(), preOrderVisitor,
            postOrderVisitor);
      }
View Full Code Here


  private double traverseImpl(JsonObject node,
      JsonVisitorDouble postOrderVisitor) throws JsonException {
    List<Double> values = new ArrayList<Double>();
    JsonValue childNode = node.get("children");
    if (childNode != JsonValue.NULL) {
      JsonArray children = childNode.asArray();
      for (int i = 0, n = children.getLength(); i < n; i++) {
        values.add(traverseImpl(children.get(i).asObject(), postOrderVisitor));
      }
    }
    return postOrderVisitor.visit(node, values);
View Full Code Here

    if (type == queryType) {
      results.add(record);
    }
    JsonValue childNode = record.get("children");
    if (childNode != JsonValue.NULL) {
      JsonArray children = childNode.asArray();
      for (int i = 0, length = children.getLength(); i < length; ++i) {
        findRecordsByTypeRecursive(children.get(i).asObject(), queryType,
            results);
      }
    }
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.