Examples of JSONArray


Examples of com.github.jsonj.JsonArray

        }
        return jjArray;
    }

    public static <T> JsonArray array(T[] array) {
        JsonArray jjArray = new JsonArray();
        for(T e: array) {
            jjArray.add(fromObject(e));
        }
        return jjArray;
    }
View Full Code Here

Examples of com.goodow.realtime.json.JsonArray

  public JsonObject toJson() {
    return model.getRoot().toJson();
  }

  public JsonArray toSnapshot() {
    final JsonArray createComponents = Json.createArray();
    final JsonArray components = Json.createArray();
    model.objects.forEach(new MapIterator<CollaborativeObjectImpl>() {
      @Override
      public void call(String key, CollaborativeObjectImpl object) {
        OperationComponent<?>[] initializeComponents = object.toInitialization();
        boolean isCreateOp = true;
        for (OperationComponent<?> component : initializeComponents) {
          if (isCreateOp) {
            createComponents.push(component.toJson());
            isCreateOp = false;
          } else {
            components.push(component.toJson());
          }
        }
      }
    });
    components.forEach(new ListIterator<JsonElement>() {
      @Override
      public void call(int index, JsonElement component) {
        createComponents.push(component);
      }
    });
View Full Code Here

Examples of com.google.appengine.labs.repackaged.org.json.JSONArray

  public static void StatusShowResp(JID fromJID, HTTPResponse response, int intType, String pageID, String keyword)
  {
    if(response.getResponseCode() == 200)
    {
      try {
        JSONArray jsonarr = new JSONArray(new String(response.getContent()));
        StatusJSON[] jsonStatus = new StatusJSON[20];
        int arrlen = jsonarr.length();
        if(arrlen == 0)
        {
          if(intType != 3)
          {
            sendMessage(fromJID,"无更多消息");
          }
          return;
        }
        for(int i=0;i<arrlen;i++)
        {
          jsonStatus[i] = new StatusJSON(jsonarr.getJSONObject(i));
        }
        if(intType == 8)
        {
          showStatus(fromJID,jsonStatus,8,arrlen,null,keyword);
        }
View Full Code Here

Examples of com.google.appengine.repackaged.org.json.JSONArray

  }

  private Work fetchWork(Config config) throws IOException, JSONException {
    JSONObject getwork = new JSONObject();
    getwork.put("method", "getwork");
    getwork.put("params", new JSONArray());
    getwork.put("id", 0);

    URL url = new URL(config.getJsonRpcServer());

    URLFetchService ufs = URLFetchServiceFactory.getURLFetchService();
View Full Code Here

Examples of com.google.collide.json.shared.JsonArray

    return 0;
  }

  @Override
  public boolean hasChildren(OutlineNode data) {
    JsonArray jsonArray = data.getChildren();
    return jsonArray != null && !jsonArray.isEmpty();
  }
View Full Code Here

Examples of com.google.gson.JsonArray

      List list = List.class.cast(payload);
      for (Object o : list) {
         checkArgument(o instanceof ServerInfo, "this binder is only valid for List<ServerInfo>!");
      }
      Iterable<ServerInfo> serverInfoList = (Iterable<ServerInfo>) payload;
      JsonArray serversJsonArray = new JsonArray();

      for (ServerInfo serverInfo : serverInfoList) {
         JsonObject driveObject = createServerInfoRequestToJson.apply(serverInfo);
         serversJsonArray.add(driveObject);
      }

      JsonObject json = new JsonObject();
      json.add("objects", serversJsonArray);
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.js.JsonArray

        int dims) {
      // override the type of the called method with the array's type
      SourceInfo sourceInfo = x.getSourceInfo().makeChild(ArrayVisitor.class,
          "Creating dimensions");
      JMethodCall call = new JMethodCall(sourceInfo, null, initDims, arrayType);
      JsonArray classLitList = new JsonArray(sourceInfo, program.getJavaScriptObject());
      JsonArray typeIdList = new JsonArray(sourceInfo, program.getJavaScriptObject());
      JsonArray queryIdList = new JsonArray(sourceInfo, program.getJavaScriptObject());
      JsonArray dimList = new JsonArray(sourceInfo, program.getJavaScriptObject());
      JType cur = arrayType;
      for (int i = 0; i < dims; ++i) {
        // Walk down each type from most dims to least.
        JArrayType curArrayType = (JArrayType) cur;
View Full Code Here

Examples of com.google.gwt.dev.json.JsonArray

      for (int i = 0; i < data.size(); i += 2) {
        jsonData.put(data.get(i), data.get(i + 1));
      }
      json.put("data", jsonData);

      JsonArray jsonChildren = JsonArray.create();
      for (Event child : children) {
        jsonChildren.add(child.toJson());
      }
      json.put("children", jsonChildren);

      return json;
    }
View Full Code Here

Examples of com.google.gwt.json.client.JSONArray

* @author Jon Crosby
*/
public class JsonResourceCollectionParser implements ResourceCollectionParser {

    public Collection parse(String text, ResourceFactory factory) {
        JSONArray json = (JSONArray) JSONParser.parse(text);
        Collection resources = new ArrayList();
           
        for (int i = 0; i < json.size(); i++) {
            Resource resource = factory.create();
            resource.populateFromRepresentation(json.get(i).isObject().toString());
            resources.add(resource);
        }
       
        return resources;
    }
View Full Code Here

Examples of com.google.gwt.thirdparty.json.JSONArray

    try {
      switch (payload.charAt(0)) {
        case '{':
          return new JsonSplittable(new JSONObject(payload));
        case '[':
          return new JsonSplittable(new JSONArray(payload));
        case '"':
          return new JsonSplittable(new JSONArray("[" + payload + "]").getString(0));
        case '-':
        case '0':
        case '1':
        case '2':
        case '3':
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.