Package org.json.simple

Examples of org.json.simple.JSONArray.addAll()


    JSONObject jsonObject = new JSONObject();

    jsonObject.put("status", new Integer(as.getCurrentState()));

    JSONArray errorCodeJson = new JSONArray();
    errorCodeJson.addAll(as.getErrorCodes());
    jsonObject.put("errorCodes", errorCodeJson);

    response.setStatus(HttpServletResponse.SC_OK);
    try {
      response.getWriter().println(jsonObject.toString());
View Full Code Here


        if (list == null) {
            return null;
        }

        JSONArray result = new JSONArray();
        result.addAll(list);

        return result;
    }

    public static String getJSONPropertyDataType(PropertyData<?> property) {
View Full Code Here

        JSONObject json = new JSONObject();

        // writing the list of flags to json

        JSONArray warring = new JSONArray();
        warring.addAll(warringClans.keySet());

        json.put("warring", warring);
        json.put("homeX", homeX);
        json.put("homeY", homeY);
        json.put("homeZ", homeZ);
View Full Code Here

        out.write(esc(fieldName));
        out.write("' style='display:none'>&nbsp;</div>");

        // create JSON objects to represent the values
        JSONArray valuesJson = new JSONArray();
        valuesJson.addAll(displayValues);
        JSONArray internalValuesJson = new JSONArray();
        internalValuesJson.addAll(internalValues);

        // write the script to setup the autocompletion
        out.write("<script type=\"text/javascript\">new Autocompleter.Local('GUI_");
View Full Code Here

        // create JSON objects to represent the values
        JSONArray valuesJson = new JSONArray();
        valuesJson.addAll(displayValues);
        JSONArray internalValuesJson = new JSONArray();
        internalValuesJson.addAll(internalValues);

        // write the script to setup the autocompletion
        out.write("<script type=\"text/javascript\">new Autocompleter.Local('GUI_");
        out.write(esc(fieldName));
        out.write("', 'cmsAutocomplete', ");
View Full Code Here

        if (list == null) {
            return null;
        }

        JSONArray result = new JSONArray();
        result.addAll(list);

        return result;
    }

    public static String getJSONPropertyDataType(PropertyData<?> property) {
View Full Code Here

    }
  }

  public static JSONArray jsonArray(JSONObject ... objects) {
    JSONArray array = new JSONArray();
    array.addAll(Arrays.asList(objects));
    return array;
  }

  /**
   * Converts pseudo-json notation to normal json notation.
View Full Code Here

    eventObject.put("seq", nextSeq());
    eventObject.put("type", "event");
    eventObject.put("event", "break");
    JSONObject body = new JSONObject();
    JSONArray bps = new JSONArray();
    bps.addAll(breakpointIds);
    body.put("breakpoints", bps);
    // TODO: add other data if needed
    eventObject.put("body", body);
    sendEvent(createMessage(eventObject.toJSONString()));
  }
View Full Code Here

        JSONObject ret = super.toJson();
        if (hasSingleAttribute()) {
            ret.put("attribute",attributes.get(0));
        } else {
            JSONArray attrs = new JSONArray();
            attrs.addAll(attributes);
            ret.put("attribute",attrs);
        }
        if (path != null) {
            ret.put("path",path);
        }
View Full Code Here

        if (list == null) {
            return null;
        }

        JSONArray result = new JSONArray();
        result.addAll(list);

        return result;
    }

    public static String getJSONPropertyDataType(PropertyData<?> property) {
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.