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
ARecordWriterimplementation 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 voidclose()Closes the output stream.voidflush()Flushes the output stream.voidwrite(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.IOExceptionDescription copied from interface:RecordWriterWrites a record object to this output stream.- Specified by:
writein 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.IOExceptionDescription copied from interface:RecordWriterFlushes the output stream.- Specified by:
flushin interfaceRecordWriter- Throws:
java.io.IOException- if an I/O error occurs flushing the stream
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:RecordWriterCloses the output stream.- Specified by:
closein interfaceRecordWriter- Throws:
java.io.IOException- if an I/O error occurs closing the stream
-
-