Package org.json

Examples of org.json.JSONObject.accumulate()


        for (Directory directory : metadata.getDirectories()) {
            if (directory != null) {
                JSONObject directoryJSON = new JSONObject();
                for (Tag tag : directory.getTags()) {
                    if (tag != null) {
                        directoryJSON.accumulate(tag.getTagName(), tag.getDescription());
                    }
                }
                String directoryName = directory.getName();
                json.accumulate(directoryName, directoryJSON);
            }
View Full Code Here


            try {
                namespaces.removeFirst();
                JSONObject properties = jsonObjects.removeFirst();
                JSONObject jsonObject = jsonObjects.getFirst();
                jsonObject.accumulate(name, properties);
            } catch (JSONException e) {
                logger.error("failed to convert XML to JSon");
                throw new WebApplicationException(e);
            }
        }
View Full Code Here

   
    PreparedQuery preparedQuery = datastore.prepare(query);

    for (Entity entity : preparedQuery.asIterable()) {
      Map<String, Object> properties = entity.getProperties();
      json.accumulate((String) properties.get("namespace"), properties);
    }

    return json;
  }
}
View Full Code Here

              // JSON creation
              JSONObject jsonProperties = new JSONObject();
         
              //for each col
              for(int j=0; j<nc; j++){
                jsonProperties.accumulate(
                    dataStoreMeta.getFieldName(j),
                    record.getFieldAt( dataStoreMeta.getFieldIndex(dataStoreMeta.getFieldName(j)) ).getValue()
                )
              }
             
View Full Code Here

        final JSONObject jsonLayer = requestData.getJSONObject("attributes").getJSONObject("mapDef").getJSONArray("layers")
                .getJSONObject(0).getInternalObj();

        for (String gmlDataName : new String[]{"spearfish-streams-v2.gml", "spearfish-streams-v311.gml"}) {
            jsonLayer.remove("url");
            jsonLayer.accumulate("url", "http://" + host + ":23432" + "/gml/" + gmlDataName);

            Values values = new Values(requestData, template, parser, getTaskDirectory(), this.requestFactory, new File("."));
            template.getProcessorGraph().createTask(values).invoke();

            @SuppressWarnings("unchecked")
View Full Code Here

        final PJsonObject pJsonObject = loadJsonRequestData();
        final PJsonObject attributesJson = pJsonObject.getJSONObject("attributes");
        final JSONObject mapDef = attributesJson.getJSONObject("mapDef").getInternalObj();
        mapDef.remove("dpi");
        mapDef.accumulate("dpi", 1000);

        final ReflectiveAttribute<MapAttribute.MapAttributeValues> mapAttribute = (ReflectiveAttribute<MapAttribute
                        .MapAttributeValues>) template.getAttributes().get("mapDef");

        final MapAttribute.MapAttributeValues value = mapAttribute.createValue(template);
View Full Code Here

      }

      try {
        /* extract the JSON object of the vertex */
        JSONObject jsonVertex = getVertex(vertex);
        jsonVertex.accumulate("_type", "vertex");
        jsonVertex.accumulate(vlabel, getVertexId().toString());
        String suffix = ",";
        if (isFirstElement) {
          isFirstElement = false;
          suffix = "";
View Full Code Here

      try {
        /* extract the JSON object of the vertex */
        JSONObject jsonVertex = getVertex(vertex);
        jsonVertex.accumulate("_type", "vertex");
        jsonVertex.accumulate(vlabel, getVertexId().toString());
        String suffix = ",";
        if (isFirstElement) {
          isFirstElement = false;
          suffix = "";
        }
View Full Code Here

      long outId = srcId.get();
      long inId = edge.getTargetVertexId().get();
      double value = edge.getValue().get();
      JSONObject jsonEdge = new JSONObject();
      jsonEdge.accumulate("_outV", outId);
      jsonEdge.accumulate("_inV",  inId);
      jsonEdge.accumulate("value", value);

      return jsonEdge;
    }
View Full Code Here

      long outId = srcId.get();
      long inId = edge.getTargetVertexId().get();
      double value = edge.getValue().get();
      JSONObject jsonEdge = new JSONObject();
      jsonEdge.accumulate("_outV", outId);
      jsonEdge.accumulate("_inV",  inId);
      jsonEdge.accumulate("value", value);

      return jsonEdge;
    }
  }
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.