Examples of JSONArray


Examples of net.yacy.cora.document.JSONArray

            // iterate over all references
            final Iterator<String> termIterator = idx.keys();
            String term;
            while (termIterator.hasNext()) {
                term = termIterator.next();
                final JSONArray references = idx.getJSONArray(term);
                // iterate until we get an exception or null
                int c = 0;
                String reference;
                final ReferenceContainer<HostReference> referenceContainer = new ReferenceContainer<HostReference>(WebStructureGraph.hostReferenceFactory, UTF8.getBytes(term));
                try {
                    while ((reference = references.getString(c++)) != null) {
                        //System.out.println("REFERENCE: " + reference);
                        referenceContainer.add(new HostReference(reference));
                    }
                } catch (final JSONException e) {} // this finishes the iteration
                index.add(referenceContainer);
View Full Code Here

Examples of org.activiti.engine.impl.util.json.JSONArray

  public String toJson(List<T> list, int indentFactor) {
    return toJsonArray(list).toString(indentFactor);
  }
 
  private JSONArray toJsonArray(List<T> objects) {
    JSONArray jsonArray = new JSONArray();
    for (T object: objects) {
      jsonArray.put(jsonObjectConverter.toJsonObject(object));
    }
    return jsonArray;
  }
View Full Code Here

Examples of org.amplafi.json.JSONArray

        jsonWriter.addRenderer(renderer);
        jsonWriter.array();
        jsonWriter.value(obj);
        jsonWriter.endArray();
        String serializedData = jsonWriter.toString();
        JSONArray jsonArray = JSONArray.toJsonArray(serializedData);
        assertNotNull(jsonArray);
        assertEquals(jsonArray.size(), 1);
        T result = (T) renderer.fromJson(renderer.getClass(), jsonArray.get(0));
        return result;
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.commons.impl.json.JSONArray

        // execute
        List<RenditionData> renditions = service.getRenditions(repositoryId, objectId, renditionFilter, maxItems,
                skipCount, null);

        JSONArray jsonRenditions = new JSONArray();
        if (renditions != null) {
            for (RenditionData rendition : renditions) {
                jsonRenditions.add(JSONConverter.convert(rendition));
            }
        }

        response.setStatus(HttpServletResponse.SC_OK);
        writeJSON(jsonRenditions, request, response);
View Full Code Here

Examples of org.apache.jena.atlas.json.JsonArray

        // ---- Results
        JsonObject results = obj.get(kResults).getAsObject() ;
        if ( ! results.get(kBindings).isArray() )
            throw new ResultSetException("'bindings' must be an array") ;
        JsonArray array = results.get(kBindings).getAsArray() ;
        Iterator<JsonValue> iter = array.iterator() ;
       
        for ( ; iter.hasNext() ; )
        {
            BindingMap b = BindingFactory.create() ;
            JsonValue v = iter.next() ;
View Full Code Here

Examples of org.apache.sling.commons.json.JSONArray

            } else {

                // Try multi-value "property"
                final String[] values = resource.adaptTo(String[].class);
                if (values != null) {
                    obj.put(ResourceUtil.getName(resource), new JSONArray(Arrays.asList(values)));
                }

            }

        } else {
View Full Code Here

Examples of org.apache.tapestry.json.JSONArray

        if ( _methodArgumentsArray == null)
        {
            try
            {
                _methodArgumentsArray = _methodArguments != null
                                        ? new JSONArray( _methodArguments )
                                        : new JSONArray();
            }
            catch (ParseException ex)
            {
                throw new ApplicationRuntimeException(ex);
            }
View Full Code Here

Examples of org.apache.tapestry5.json.JSONArray

        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

Examples of org.apache.tomcat.util.json.JSONArray

        int result = 0;
        if (message==null || message.length()==0) return result;
        try {
            BayeuxRequest request = null;
            //a message can be an array of messages
            JSONArray jsArray = new JSONArray(message);
            for (int i = 0; i < jsArray.length(); i++) {
                JSONObject msg = jsArray.getJSONObject(i);
               
                if (log.isTraceEnabled()) {
                    log.trace("["+Thread.currentThread().getName()+"] Processing bayeux message:"+msg);
                }
                request = RequestFactory.getRequest(tb,event,msg);
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONArray

          appendListenerHandler(precondition, attributesJson, "pre",
            PRECONDITION_FUNCTION_TEMPLATE);
        }
      }

      JSONArray extraParameters = JsonUtils.asArray(attributes.getExtraParameters());

      if (extraParameters.length() > 0)
      {
        attributesJson.put("ep", extraParameters);
      }

      List<CharSequence> dynamicExtraParameters = attributes.getDynamicExtraParameters();
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.