use of com.linkedin.data.template.JacksonDataTemplateCodec in project rest.li by linkedin.
the class IndentedPdlBuilder method writeJson.
@Override
PdlBuilder writeJson(Object value, DataSchema schema) throws IOException {
if (schema != null) {
JacksonDataTemplateCodec jsonCodec = new JacksonDataTemplateCodec();
jsonCodec.setPrettyPrinter(getPrettyPrinter());
write(toJson(value, jsonCodec, schema));
} else {
JacksonDataCodec jsonCodec = new JacksonDataCodec();
jsonCodec.setPrettyPrinter(getPrettyPrinter());
jsonCodec.setSortKeys(true);
write(toJson(value, jsonCodec));
}
return this;
}
Aggregations