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, writeValue
public JsonWriter(Writer out)
out
- public JsonWriter(Writer out, JsonParserConfiguration config)
out
- public void write(Object record) throws IOException
RecordWriter
write
in interface RecordWriter
record
- the record object to writeIOException
- if an I/O error occurs writing the record to the streampublic void flush() throws IOException
RecordWriter
flush
in interface RecordWriter
IOException
- if an I/O error occurs flushing the streampublic void close() throws IOException
RecordWriter
close
in interface RecordWriter
IOException
- if an I/O error occurs closing the stream