Search in sources :

Example 1 with WriterBasedGenerator

use of org.codehaus.jackson.impl.WriterBasedGenerator in project databus by linkedin.

the class AbstractRequestProcesser method createJsonGenerator.

protected JsonGenerator createJsonGenerator(ObjectCodec codec, Writer writer, boolean prettyPrint) {
    IOContext ioCtx = new IOContext(new BufferRecycler(), null, true);
    WriterBasedGenerator result = new WriterBasedGenerator(ioCtx, 0, codec, writer);
    result.configure(Feature.QUOTE_FIELD_NAMES, true);
    if (prettyPrint)
        result.useDefaultPrettyPrinter();
    return result;
}
Also used : WriterBasedGenerator(org.codehaus.jackson.impl.WriterBasedGenerator) BufferRecycler(org.codehaus.jackson.util.BufferRecycler) IOContext(org.codehaus.jackson.io.IOContext)

Aggregations

WriterBasedGenerator (org.codehaus.jackson.impl.WriterBasedGenerator)1 IOContext (org.codehaus.jackson.io.IOContext)1 BufferRecycler (org.codehaus.jackson.util.BufferRecycler)1