/** * Writes the given JSON-LD Object out to a String. * * @param jsonObject * The JSON-LD Object to serialize. * @return A JSON document serialised to a String. * @throws JsonGenerationException * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ public static String toString(Object jsonObject) throws JsonGenerationException, IOException { final StringWriter sw = new StringWriter(); write(sw, jsonObject); return sw.toString(); }
JsonUtils.writePrettyPrint(writer, output); } else { JsonUtils.write(writer, output);
private void serialize(Writer writer, DatasetGraph dataset, PrefixMap prefixMap, String baseURI, Context jenaContext) { try { Object obj = toJsonLDJavaAPI(getVariant(), dataset, prefixMap, baseURI, jenaContext); if (getVariant().isPretty()) { JsonUtils.writePrettyPrint(writer, obj) ; } else { JsonUtils.write(writer, obj) ; } writer.write("\n") ; } catch (JsonLdError | JsonMappingException | JsonGenerationException e) { throw new RiotException(e) ; } catch (IOException e) { IO.exception(e) ; } }
/** * Writes the given JSON-LD Object out to a String. * * @param jsonObject * The JSON-LD Object to serialize. * @return A JSON document serialised to a String. * @throws JsonGenerationException * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ public static String toString(Object jsonObject) throws JsonGenerationException, IOException { final StringWriter sw = new StringWriter(); write(sw, jsonObject); return sw.toString(); }
JsonUtils.writePrettyPrint(writer, output); } else { JsonUtils.write(writer, output);
/** * Writes the given JSON-LD Object out to a String. * * @param jsonObject * The JSON-LD Object to serialize. * @return A JSON document serialised to a String. * @throws JsonGenerationException * If there is a JSON error during serialization. * @throws IOException * If there is an IO error during serialization. */ public static String toString(Object jsonObject) throws JsonGenerationException, IOException { final StringWriter sw = new StringWriter(); write(sw, jsonObject); return sw.toString(); }
JsonUtils.writePrettyPrint(writer, output); } else { JsonUtils.write(writer, output);
JsonUtils.writePrettyPrint(writer, output); } else { JsonUtils.write(writer, output);
JsonUtils.write(writer, output);
JsonUtils.write(writer, output);