Examples of JsonArray


Examples of ar.com.restba.json.JsonArray

            Object result = method.invoke(bean, (Object[]) null);
            if (result == null) {
              map.put(key, NULL);
            } else if (result.getClass().isArray()) {
              map.put(key, new JsonArray(result, includeSuperClass));
            } else if (result instanceof Collection<?>) { // List or Set
              map.put(key, new JsonArray((Collection<?>) result, includeSuperClass));
            } else if (result instanceof Map<?, ?>) {
              map.put(key, new JsonObject((Map<?, ?>) result, includeSuperClass));
            } else if (isStandardProperty(result.getClass())) { // Primitives,
              // String and
              // Wrapper
View Full Code Here

Examples of bgu.bio.io.file.json.JSONArray

  }

  public static FixedStepRangesTable BuildFromJSON(JSONObject json) {
    FixedStepRangesTable table = null;
    try {
      JSONArray a = json.getJSONArray("rangetable");
      int len = a.length();
      table = new FixedStepRangesTable(json.getDouble("first"),
          json.getDouble("last"), json.getDouble("step"));
      for (int i = 0; i < len; i++) {
        JSONArray b = a.getJSONArray(i);
        Range r = table.getRange(b.getDouble(0));
        r.setTuplePassed(b.getInt(1));
        r.setTupleFailed(b.getInt(2));
      }
    } catch (JSONException e) {
      e.printStackTrace();
    }
    return table;
View Full Code Here

Examples of blackberry.common.util.json4j.JSONArray

     * *param array An array instance to populate instead of creating a new one.
     *
     * @throws JSONException Thrown if a parse error occurs, such as a malformed JSON array.
     */
    public JSONArray parseArray(boolean ordered, JSONArray array) throws JSONException {
        JSONArray result = null;
        if(array != null){
            result = array;
        } else {
            result = new JSONArray();
        }

        try {
            if (lastToken != Token.TokenBrackL) throw new JSONException("Expecting '[' " + tokenizer.onLineCol());
            lastToken = tokenizer.next();
            while (true) {
                if (lastToken == Token.TokenEOF) throw new JSONException("Unterminated array " + tokenizer.onLineCol());

                /**
                 * End of the array.
                 */
                if (lastToken == Token.TokenBrackR) {
                    lastToken = tokenizer.next();
                    break;
                }

                Object val = parseValue(ordered);
                result.add(val);

                if (lastToken == Token.TokenComma) {
                    lastToken = tokenizer.next();
                } else if (lastToken != Token.TokenBrackR) {
                    throw new JSONException("expecting either ',' or ']' " + tokenizer.onLineCol());
View Full Code Here

Examples of br.com.digilabs.jqplot.json.JSONArray

    public Collection<T> getData() {
        return data;
    }

    public String toJsonString() {
        JSONArray jsonArray = new JSONArray();
        jsonArray.put(data);
        return jsonArray.toString();
    }   
View Full Code Here

Examples of br.digilabs.jqplot.json.JSONArray

    public Collection<List<T>> getData() {
        return data;
    }

    public String toJsonString() {
        JSONArray jsonArray = new JSONArray(data);
        return jsonArray.toString();
    }
View Full Code Here

Examples of ch.bfh.sokoban.lib.jsonJava.JSONArray

   * Add the database options for the php - file to a nameValuePair
   */
  private static void addOptions(Options options)
  {
    jsonObject = new JSONObject();
    jsonArray = new JSONArray();

    try
    {
      jsonObject.put("query", options.getSql());
      jsonObject.put("usesInsertId", Boolean.toString(options.hasInsertId()));
View Full Code Here

Examples of com.addthis.maljson.JSONArray

            throw new RuntimeException(ex);
        }
    }

    private static Object encodeArray(Object value) throws Exception {
        JSONArray arr = new JSONArray();
        int len = Array.getLength(value);
        for (int i = 0; i < len; i++) {
            arr.put(encodeObject(Array.get(value, i)));
        }
        return arr;
    }
View Full Code Here

Examples of com.alibaba.fastjson.JSONArray

      cppn.setPhoneID(o.getPhoneID());
      cppn.setIsSend(false);
      cppn.setMessageID(pnm.getEncodedKey());
      cppn_service.add(cppn);

      JSONArray phoneArray = retJson.getJSONArray("phoneArray");
      if (null == phoneArray)
        phoneArray = new JSONArray();

      phoneArray.add(o.getPhoneID());
      retJson.put("phoneArray", phoneArray);
    }

    return retJson;
  }
View Full Code Here

Examples of com.alimama.mdrill.json.JSONArray

    return rtn;
  }
 
  private static String[] Json2Array(String j) throws JSONException
  {
      JSONArray jsonStr=new JSONArray(j.trim());
      ArrayList<String> rtn=new ArrayList<String>();
      for(int i=0;i<jsonStr.length();i++)
      {
        rtn.add(jsonStr.getString(i));
      }
     
      return rtn.toArray(new String[rtn.size()]);

  }
View Full Code Here

Examples of com.amazonaws.util.json.JSONArray

            if (Arrays.asList(JSONObject.getNames(jPolicy)).contains(JsonDocumentFields.POLICY_ID)) {
                policy.setId(jPolicy.getString(JsonDocumentFields.POLICY_ID));
            }

            JSONArray jStatements = jPolicy.getJSONArray(JsonDocumentFields.STATEMENT);

            for (int index = 0 ; index < jStatements.length() ; index++) {
                Statement statement = convertStatement(jStatements.getJSONObject(index));
                if (statement != null) {
                statements.add(statement);
                }
            }
        } catch (Exception e) {
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.