Package org.beanio.stream.json
Class JsonWriter
- java.lang.Object
-
- org.beanio.stream.json.JsonWriterSupport
-
- org.beanio.stream.json.JsonWriter
-
- All Implemented Interfaces:
RecordWriter
public class JsonWriter extends JsonWriterSupport implements RecordWriter
ARecordWriter
implementation for writing JSON formatted record.- Since:
- 2.0
- See Also:
JsonRecordParserFactory
-
-
Constructor Summary
Constructors Constructor Description JsonWriter(java.io.Writer out)
Constructs a newJsonWriter
.JsonWriter(java.io.Writer out, JsonParserConfiguration config)
Constructs a newJsonWriter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the output stream.void
flush()
Flushes the output stream.void
write(java.lang.Object record)
Writes a record object to this output stream.-
Methods inherited from class org.beanio.stream.json.JsonWriterSupport
getIndent, getLineSeparator, init, isPretty, write, writeArray, writeString, writeValue
-
-
-
-
Constructor Detail
-
JsonWriter
public JsonWriter(java.io.Writer out)
Constructs a newJsonWriter
.- Parameters:
out
-
-
JsonWriter
public JsonWriter(java.io.Writer out, JsonParserConfiguration config)
Constructs a newJsonWriter
.- Parameters:
out
-
-
-
Method Detail
-
write
public void write(java.lang.Object record) throws java.io.IOException
Description copied from interface:RecordWriter
Writes a record object to this output stream.- Specified by:
write
in interfaceRecordWriter
- Parameters:
record
- the record object to write- Throws:
java.io.IOException
- if an I/O error occurs writing the record to the stream
-
flush
public void flush() throws java.io.IOException
Description copied from interface:RecordWriter
Flushes the output stream.- Specified by:
flush
in interfaceRecordWriter
- Throws:
java.io.IOException
- if an I/O error occurs flushing the stream
-
close
public void close() throws java.io.IOException
Description copied from interface:RecordWriter
Closes the output stream.- Specified by:
close
in interfaceRecordWriter
- Throws:
java.io.IOException
- if an I/O error occurs closing the stream
-
-