public class JsonWriter extends JsonWriterSupport implements RecordWriter
RecordWriter implementation for writing JSON formatted record.JsonRecordParserFactory| Constructor and Description |
|---|
JsonWriter(Writer out)
Constructs a new JsonWriter.
|
JsonWriter(Writer out,
JsonParserConfiguration config)
Constructs a new JsonWriter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the output stream.
|
void |
flush()
Flushes the output stream.
|
void |
write(Object record)
Writes a record object to this output stream.
|
getIndent, getLineSeparator, init, isPretty, write, writeArray, writeString, writeValuepublic JsonWriter(Writer out)
out - public JsonWriter(Writer out, JsonParserConfiguration config)
out - public void write(Object record) throws IOException
RecordWriterwrite in interface RecordWriterrecord - the record object to writeIOException - if an I/O error occurs writing the record to the streampublic void flush()
throws IOException
RecordWriterflush in interface RecordWriterIOException - if an I/O error occurs flushing the streampublic void close()
throws IOException
RecordWriterclose in interface RecordWriterIOException - if an I/O error occurs closing the stream