public class CSVPrinter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected char[] |
buf |
protected boolean |
newLine
True if we just began a new line.
|
protected java.io.Writer |
out
The place that the values get written.
|
protected CSVStrategy |
strategy |
| Constructor and Description |
|---|
CSVPrinter(java.io.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(java.lang.String value)
Print the string as the next value on the line.
|
void |
print(java.lang.String value,
boolean checkForEscape)
Print the string as the next value on the line.
|
(package private) void |
printAndEncapsulate(char[] value,
int offset,
int len) |
(package private) void |
printAndEscape(char[] value,
int offset,
int len) |
void |
println()
Output a blank line
|
void |
println(java.lang.String[] values)
Print a single line of comma separated values.
|
void |
printlnComment(java.lang.String comment)
Put a comment among the comma separated values.
|
(package private) void |
printSep() |
protected final java.io.Writer out
protected final CSVStrategy strategy
protected boolean newLine
protected char[] buf
public CSVPrinter(java.io.Writer out,
CSVStrategy strategy)
out - stream to which to print.strategy - describes the CSV variation.public void println()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
java.io.IOExceptionpublic void println(java.lang.String[] values)
throws java.io.IOException
values - values to be outputted.java.io.IOExceptionpublic void printlnComment(java.lang.String comment)
throws java.io.IOException
comment - the comment to outputjava.io.IOExceptionpublic void print(char[] value,
int offset,
int len,
boolean checkForEscape)
throws java.io.IOException
java.io.IOExceptionvoid printSep()
throws java.io.IOException
java.io.IOExceptionvoid printAndEscape(char[] value,
int offset,
int len)
throws java.io.IOException
java.io.IOExceptionvoid printAndEncapsulate(char[] value,
int offset,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void print(java.lang.String value,
boolean checkForEscape)
throws java.io.IOException
value - value to be outputted.java.io.IOExceptionpublic void print(java.lang.String value)
throws java.io.IOException
value - value to be outputted.java.io.IOException