Package net.minidev.json

Examples of net.minidev.json.JSONObject.writeJSONString()


    obj.put("outEdges", vrec.outEdges());
    obj.put("mirrors", vrec.mirrorList());
    obj.put("vdata", vrec.vdata());
    StringWriter out = new StringWriter();
    try {
      obj.writeJSONString(out);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return out;
  }
View Full Code Here


    try {
      for (int i = 0; i < sortedKey.size(); i++) {
        obj.clear();
        obj.put("source", sortedKey.get(i));
        obj.put("targets", ((SimpleGraph) g).outEdgeTargetIds(sortedKey.get(i)));
        obj.writeJSONString(out);
        out.append("\n");
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

  public StringWriter vid2lvidWriter(GLGraph g) {
    JSONObject obj = new JSONObject();
    obj.put("vid2lvid", g.vid2lvid());
    StringWriter out = new StringWriter();
    try {
      obj.writeJSONString(out);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return out;
  }
View Full Code Here

  public StringWriter edataWriter(Graph g) {
    JSONObject obj = new JSONObject();
    obj.put("edataList", ((GLGraph) g).edatalist());
    StringWriter out = new StringWriter();
    try {
      obj.writeJSONString(out);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return out;
  }
View Full Code Here

    obj.put("csr", g.csr().toJSONObj());
    obj.put("csc", g.csc().toJSONObj());
    obj.put("c2rMap", g.c2rMap());
    StringWriter out = new StringWriter();
    try {
      obj.writeJSONString(out);
    } catch (IOException e) {
      e.printStackTrace();
    }
    return out;
  }
View Full Code Here

                JSONValue.writeJSONString(ret, response.getWriter());
            }
        } catch (JsonException ex) {
            JSONObject ret = new JSONObject();
            ret.put("error", ex.getMessage());
            ret.writeJSONString(response.getWriter());
        } catch (Throwable t) {
            logger.log(Level.SEVERE, "action " + actionName + " failed ", t);
        }

        Performance.timing("arago.portlet.dispatch.json", System.currentTimeMillis() - then);
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.