use of com.fasterxml.jackson.core.JsonGenerationException in project jena by apache.
the class JsonLDWriter method serialize.
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);
}
}
use of com.fasterxml.jackson.core.JsonGenerationException in project dropbox-sdk-java by dropbox.
the class StoneSerializer method serialize.
public void serialize(T value, OutputStream out, boolean pretty) throws IOException {
JsonGenerator g = Util.JSON.createGenerator(out);
if (pretty) {
g.useDefaultPrettyPrinter();
}
try {
serialize(value, g);
} catch (JsonGenerationException ex) {
throw new IllegalStateException("Impossible JSON generation exception", ex);
}
g.flush();
}
Aggregations