| Constructor and Description |
|---|
CSVPrinter(Appendable out,
CSVFormat format)
Creates a printer that will print values to the given stream following the CSVFormat.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flushes the underlying stream.
|
void |
print(Object value)
Prints the string as the next value on the line.
|
void |
printComment(String comment)
Prints a comment on a new line among the delimiter separated values.
|
void |
println()
Outputs the line separator.
|
void |
printRecord(Iterable<?> values)
Prints a single line of delimiter separated values.
|
void |
printRecord(Object... values)
Prints a single line of delimiter separated values.
|
void |
printRecords(Iterable<?> values)
Prints all the objects in the given collection.
|
void |
printRecords(Object[] values)
Prints all the objects in the given array.
|
void |
printRecords(ResultSet resultSet)
Prints all the objects in the given JDBC result set.
|
public CSVPrinter(Appendable out, CSVFormat format)
out - stream to which to print.format - the CSV format. If null the default format is used (CSVFormat.DEFAULT)IllegalArgumentException - thrown if the parameters of the format are inconsistentpublic void println()
throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void printRecord(Object... values) throws IOException
values - values to output.IOExceptionpublic void printRecord(Iterable<?> values) throws IOException
values - values to output.IOExceptionpublic void printComment(String comment) throws IOException
comment - the comment to outputIOExceptionpublic void print(Object value) throws IOException
value - value to be output.IOException - If an I/O error occurspublic void printRecords(Object[] values) throws IOException
values - the values to print.IOException - If an I/O error occurspublic void printRecords(Iterable<?> values) throws IOException
values - the values to print.IOException - If an I/O error occurspublic void printRecords(ResultSet resultSet) throws SQLException, IOException
resultSet - result set
the values to print.IOException - If an I/O error occursSQLExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.