Examples of writeJSONString()


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

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

    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

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

  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

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

  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

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

    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

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

                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

Examples of org.jboss.dmr.ModelNode.writeJSONString()

            node.get(entry.getKey(), entry.getValue());
        }
        resp.setContentType("application/json");
        final PrintWriter out = resp.getWriter();
        try {
            node.writeJSONString(out, true);
        } finally {
            out.close();
        }
    }
}
View Full Code Here

Examples of org.json.simple.JSONArray.writeJSONString()

            JSONArray versions = new JSONArray();
            versions.add(-11);
            versions.add(-10);
            Writer writer = new StringWriter();
            versions.writeJSONString(writer);
            writer.flush();

            when(result.getInputStream()).thenReturn(new ByteArrayInputStream(writer.toString().getBytes()));
            return result;
        }
View Full Code Here

Examples of org.json.simple.JSONArray.writeJSONString()

            JSONArray versions = new JSONArray();
            versions.add(-11);
            versions.add(-10);
            Writer writer = new StringWriter();
            versions.writeJSONString(writer);
            writer.flush();

            when(result.getInputStream()).thenReturn(new ByteArrayInputStream(writer.toString().getBytes()));
            return result;
        }
View Full Code Here

Examples of org.json.simple.JSONArray.writeJSONString()

            }
            array.add(obj);
        }

        try (Writer writer = new FileWriter(file)) {
            array.writeJSONString(writer);
        } catch (Exception ex) {
            GlowServer.logger.log(Level.SEVERE, "Error writing to: " + file, ex);
        }
    }
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.