public class CsvExportWriter extends java.lang.Object implements IExportWriter
Constructor and Description |
---|
CsvExportWriter(javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
beginDocument(java.lang.String name,
java.io.OutputStream out)
Initializes CSV document stringbuffer
|
void |
beginRow()
Represents a new row when writing entries to a csv file.
|
void |
emitCell(int cellPos,
java.lang.Object val,
int maxType,
ICellStyle style,
IExportContext context)
Formats values accordingly based on the type of object and encodes double quotes and wraps strings
containing commas with quotes and then writes encoded string to the buffer.
|
void |
emitComma()
Writes a single comma string value to the buffer.
|
void |
endDocument()
Writes the buffer to the response.
|
void |
endRow()
Writes a new line to the buffer
|
public CsvExportWriter(javax.servlet.http.HttpServletResponse response)
public void beginDocument(java.lang.String name, java.io.OutputStream out)
beginDocument
in interface IExportWriter
name
- - the name of the sheet created in the excel fileout
- - output streampublic void endDocument()
endDocument
in interface IExportWriter
public void beginRow()
beginRow
in interface IExportWriter
public void endRow()
endRow
in interface IExportWriter
public void emitComma()
emitComma
in interface IExportWriter
public void emitCell(int cellPos, java.lang.Object val, int maxType, ICellStyle style, IExportContext context)
emitCell
in interface IExportWriter
val
- - Object that gets encoded and written to buffer.maxtype
- - String type of data object