|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.doolin.tabular.csv.CSVWriter<T>
T - Type of object per rowpublic class CSVWriter<T>
Writer for CSV format.
| Constructor Summary | |
|---|---|
CSVWriter()
|
|
| Method Summary | |
|---|---|
protected String |
getCSVValue(Object value)
Adapts a value for CSV |
CSVAdapter |
getDefaultAdapter()
Returns the defaultAdapter property. |
String |
getEncoding()
Returns the encoding property. |
String |
getSeparator()
Returns the separator property. |
void |
setDefaultAdapter(CSVAdapter defaultAdapter)
Sets the defaultAdapter property. |
void |
setEncoding(String encoding)
Sets the encoding property. |
void |
setSeparator(String separator)
Sets the separator property. |
void |
write(OutputStream output,
TabularModel<T> model)
Writes the given tabular data into the given output stream |
protected void |
writeLine(PrintWriter writer,
List<String> line)
Writes a line in the CSV destination. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CSVWriter()
| Method Detail |
|---|
public CSVAdapter getDefaultAdapter()
defaultAdapter property.
defaultAdapter property.public String getEncoding()
encoding property. It defaults to UTF-8.
encoding property.public String getSeparator()
separator property. It defaults to ",".
separator property.public void setDefaultAdapter(CSVAdapter defaultAdapter)
defaultAdapter property.
defaultAdapter - defaultAdapter property.public void setEncoding(String encoding)
encoding property. It defaults to UTF-8.
encoding - encoding property.public void setSeparator(String separator)
separator property. It defaults to ",".
separator - separator property.
public void write(OutputStream output,
TabularModel<T> model)
throws IOException
TabularWriter
write in interface TabularWriter<T>output - Output stream to write tomodel - Data to write
IOException - Thrown if an error occurs during the writing.protected String getCSVValue(Object value)
value - Value to adapt
protected void writeLine(PrintWriter writer,
List<String> line)
writer - Writer to write toline - Line to write
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||