public class CSVWriter extends java.io.BufferedWriter implements ExportWriter
| Constructor and Description |
|---|
CSVWriter(java.io.Writer out)
Constructor
|
CSVWriter(java.io.Writer out,
char separator)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getContents()
Get the String version of the values written so far.
|
java.lang.String |
getFileExtension()
Get the extension of the file to be exported.
|
java.lang.String |
getHeaderText() |
java.lang.String |
getMimeType()
Get the mime type of the output
|
void |
setColumns(java.util.List<java.lang.String> columnsIn)
Set columns
|
void |
setHeaderText(java.lang.String headerIn)
Sets an optional header string.
|
void |
write(java.util.List listIn)
Write the List of values to the contents of this Writer.
|
void |
write(java.lang.String s)
Write a string to the Writer
|
void |
writeHeader()
Write the header to the stream
|
void |
writeSeparator()
Write the separator to the Writer
|
public CSVWriter(java.io.Writer out)
out - Writer to send CSV topublic CSVWriter(java.io.Writer out,
char separator)
out - Writer to send CSV toseparator - Separator character to usepublic void setColumns(java.util.List<java.lang.String> columnsIn)
setColumns in interface ExportWritercolumnsIn - List of Strings containing the names of the columnspublic void setHeaderText(java.lang.String headerIn)
headerIn - This will become the
first line of the export CSV contents.public java.lang.String getHeaderText()
public void writeHeader()
public void write(java.util.List listIn)
write in interface ExportWriterlistIn - that you want writen to the contentspublic void write(java.lang.String s)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void writeSeparator()
throws java.io.IOException
java.io.IOException - if there is a Writer errorpublic java.lang.String getContents()
getContents in interface ExportWriterpublic java.lang.String getMimeType()
getMimeType in interface ExportWriterpublic java.lang.String getFileExtension()
getFileExtension in interface ExportWriter