public class CSVPrinter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected char[] |
buf |
protected boolean |
newLine
True if we just began a new line.
|
protected Writer |
out
The place that the values get written.
|
protected CSVStrategy |
strategy |
| Constructor and Description |
|---|
CSVPrinter(Writer out,
CSVStrategy strategy)
Create a printer that will print values to the given
stream following the CSVStrategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush() |
void |
print(char[] value,
int offset,
int len,
boolean checkForEscape) |
void |
print(String value)
Print the string as the next value on the line.
|
void |
print(String value,
boolean checkForEscape)
Print the string as the next value on the line.
|
void |
println()
Output a blank line
|
void |
println(String[] values)
Print a single line of comma separated values.
|
void |
printlnComment(String comment)
Put a comment among the comma separated values.
|
protected final Writer out
protected final CSVStrategy strategy
protected boolean newLine
protected char[] buf
public CSVPrinter(Writer out, CSVStrategy strategy)
out - stream to which to print.strategy - describes the CSV variation.public void println()
throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void println(String[] values) throws IOException
values - values to be outputted.IOExceptionpublic void printlnComment(String comment) throws IOException
comment - the comment to outputIOExceptionpublic void print(char[] value,
int offset,
int len,
boolean checkForEscape)
throws IOException
IOExceptionpublic void print(String value, boolean checkForEscape) throws IOException
value - value to be outputted.IOExceptionpublic void print(String value) throws IOException
value - value to be outputted.IOExceptionCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.