Examples of JsonArray


Examples of org.jose4j.json.internal.json_simple.JSONArray

    return m;
  }
 
  private List createArrayContainer(ContainerFactory containerFactory){
    if(containerFactory == null)
      return new JSONArray();
    List l = containerFactory.creatArrayContainer();
   
    if(l == null)
      return new JSONArray();
    return l;
  }
View Full Code Here

Examples of org.json.JSONArray

                    try
                    {
                        api.getTransaction().begin();
                        Query query = api.newQuery("JDOQL", queryString);
                        List result = (List)query.execute();
                        JSONArray array = new JSONArray(result);
                        resp.getWriter().write(array.toString());
                        resp.setHeader("Content-Type", "application/json");
                        resp.setStatus(200);
                        api.getTransaction().commit();
                    }
                    finally
View Full Code Here

Examples of org.json.jdk5.simple.JSONArray

    SscfInbox si = new SscfInbox();
    return si.getJSONInboxContent(request, mbox);
  }
 
  public static String getThesauri() {
    JSONArray ja = new JSONArray();
   
    for(ThesaurusContext context:Thesauri.getInstance().getContexts())
    {
      JSONObject jo = new JSONObject();
      jo.put("label", context.getLabel());
      jo.put("uri", context.getUri().toString());
     
      ja.add(jo);
    }
   
    return ja.toString();
  }
View Full Code Here

Examples of org.json.me.JSONArray

        log("Parsing #records=" + numRecords);

        /*
         * Only unpick the message if it contains a non-zero number of records
         */
        JSONArray recordsArray = new JSONArray();
        result.put(Constants.NDEF_RECORDS, recordsArray);

        if (numRecords > 0) {
            /*
             * Work our way through each record in the message in turn
             */
            for (int j = 0; j < numRecords; ++j) {
                log("parseMessage record #" + j);

                NDEFRecord currentRecord = records[j];
                JSONObject jsonRecord = new JSONObject();
                recordsArray.put(jsonRecord);

                log("Processing NDEF record#=" + j);

                typeNameFormat = currentRecord.getTypeNameFormat();
                record_type = records[j].getType();
View Full Code Here

Examples of org.json.simple.JSONArray

  protected void
  encodeResults(
    Subscription  subs,
    Map        result )
  {
    JSONArray  results_list = new JSONArray();
   
    SubscriptionResult[]  results = subs.getHistory().getResults( false );
   
    for(int i=0; i<results.length; i++){
     
      SubscriptionResult r = results[i];
     
      results_list.add( r.toJSONMap());
    }
   
    result.put( "results", results_list );
   
   
View Full Code Here

Examples of org.json_voltpatches.JSONArray

    }

    @Override
    public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException {
        helpLoadFromJSONObject(jobj, db);
        JSONArray jarray = jobj.getJSONArray( Members.AGGREGATE_COLUMNS.name() );
        int size = jarray.length();
        for (int i = 0; i < size; i++) {
            JSONObject tempObj = jarray.getJSONObject( i );
            m_aggregateTypes.add( ExpressionType.get( tempObj.getString( Members.AGGREGATE_TYPE.name() )));
            m_aggregateDistinct.add( tempObj.getInt( Members.AGGREGATE_DISTINCT.name() ) );
            m_aggregateOutputColumns.add( tempObj.getInt( Members.AGGREGATE_OUTPUT_COLUMN.name() ));

            if (jobj.isNull(Members.AGGREGATE_EXPRESSION.name())) {
                m_aggregateExpressions.add(null);
            }
            else {
                m_aggregateExpressions.add(
                    AbstractExpression.fromJSONChild(tempObj, Members.AGGREGATE_EXPRESSION.name()));
            }
        }
        AbstractExpression.loadFromJSONArrayChild(m_groupByExpressions, jobj,
                                                  Members.GROUPBY_EXPRESSIONS.name(), null);

        if ( ! jobj.isNull(Members.PARTIAL_GROUPBY_COLUMNS.name())) {
            JSONArray jarray2 = jobj.getJSONArray(Members.PARTIAL_GROUPBY_COLUMNS.name());
            int numCols = jarray2.length();
            m_partialGroupByColumns = new ArrayList<>(numCols);
            for (int ii = 0; ii < numCols; ++ii) {
                m_partialGroupByColumns.add(jarray2.getInt(ii));
            }
        }

        m_prePredicate = AbstractExpression.fromJSONChild(jobj, Members.PRE_PREDICATE.name());
        m_postPredicate = AbstractExpression.fromJSONChild(jobj, Members.POST_PREDICATE.name());
View Full Code Here

Examples of org.myphotodiary.json.JsonArray

        rsp.addParameter(Configuration.groupParam,
            (directory.getGroup() == null ? Configuration.publicGroup : directory.getGroup().getGroupName()));

        List<Attribute> dirAttributes = directory.getAttributes();
        if (dirAttributes != null) {
          JsonArray attributes = new JsonArray();
          for (Attribute attribute: dirAttributes) {
            attributes.addItem(attribute.getName());
          }
          rsp.addParameter(Configuration.attrParam, attributes);
        }
      }
      else {
View Full Code Here

Examples of org.openfaces.org.json.JSONArray

                }
            }
            return jsonObj;
        } else if (jsonParam.has(AJAX_FILES_REQUEST)) {
            JSONObject jsonObj = new JSONObject();
            JSONArray files = (JSONArray) jsonParam.get(AJAX_PARAM_FILES_ID);
            boolean allUploaded = true;
            Map<String, Object> sessionMap = context.getExternalContext().getSessionMap();
            for (int i = 0; i < files.length(); i++) {
                JSONArray file = files.getJSONArray(i);
                if (file.getString(3).equals("SUCCESSFUL")) {
                    if (!sessionMap.containsKey(file.getString(0))) {
                        allUploaded = false;
                        break;
                    }
                }
            }
            JSONArray fileSizes = new JSONArray();
            if (allUploaded) {
                List<FileUploadItem> filesItems = new LinkedList<FileUploadItem>();
                for (int i = 0; i < files.length(); i++) {
                    JSONArray file = files.getJSONArray(i);
                    if (file.getString(3).equals("SUCCESSFUL")) {
                        FileUploadItem fileUploadItem = (FileUploadItem) sessionMap.get(file.getString(0));
                        filesItems.add(fileUploadItem);
                        sessionMap.remove(file.getString(0));

                        JSONArray jsonArray = new JSONArray();
                        jsonArray.put(file.getString(4));
                        jsonArray.put(fileUploadItem.getFile().length());
                        fileSizes.put(jsonArray);

                    } else if (file.getString(3).equals("STOPPED")) {
                        filesItems.add(new FileUploadItem(file.getString(2), null, FileUploadStatus.STOPPED));
                        sessionMap.remove(PROGRESS_ID + file.getString(1));
View Full Code Here

Examples of org.openjena.atlas.json.JsonArray

    }

    @Override
    public void startArray(long currLine, long currCol)
    {
        arrays.push(new JsonArray()) ;
    }
View Full Code Here

Examples of org.openx.data.jsonserde.json.JSONArray

        assertTrue(19.5 == jsfOi.get(soi.getStructFieldData(result, soi.getStructFieldRef("two"))));
       
        Object ar = soi.getStructFieldData(result, soi.getStructFieldRef("three"));
        assertTrue(ar instanceof JSONArray);
       
        JSONArray jar = (JSONArray)ar;
        assertTrue( jar.get(0) instanceof String );
        assertEquals("red", jar.get(0));
       
    }
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.