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
IOException
public void flush() throws IOException
IOException
public void println(String[] values) throws IOException
values
- values to be outputted.IOException
public void printlnComment(String comment) throws IOException
comment
- the comment to outputIOException
public void print(char[] value, int offset, int len, boolean checkForEscape) throws IOException
IOException
public void print(String value, boolean checkForEscape) throws IOException
value
- value to be outputted.IOException
public void print(String value) throws IOException
value
- value to be outputted.IOException
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.