|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.upc.dama.dex.io.CSVWriter
public class CSVWriter
A very simple CSV writer.
Using the format RFC 4180
Default values:
Separator = ','
Quote Character = '"'
Automatic quote = true
| Field Summary | |
|---|---|
static boolean |
DEFAULT_AUTO_QUOTE
Default autoquoted option |
static char |
DEFAULT_QUOTE_CHARACTER
The default quote character to use if none is supplied to the constructor. |
static char |
DEFAULT_SEPARATOR
Default separator character. |
| Constructor Summary | |
|---|---|
CSVWriter(java.io.Writer writer)
Create a new instance of CSVWriter. |
|
CSVWriter(java.io.Writer writer,
char separator)
Create a new instance of CSVWriter. |
|
CSVWriter(java.io.Writer writer,
char separator,
char quotechar)
Create a new instance of CSVWriter. |
|
CSVWriter(java.io.Writer writer,
char separator,
char quotechar,
boolean autoquote)
Create a new instance of CSVWriter. |
|
CSVWriter(java.io.Writer writer,
char separator,
char quotechar,
boolean[] selectedquotes)
Create a new instance of CSVWriter. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the underlying writer. |
void |
writeNext(java.lang.String[] row)
Writes the next row as a string array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final char DEFAULT_SEPARATOR
public static final char DEFAULT_QUOTE_CHARACTER
public static final boolean DEFAULT_AUTO_QUOTE
| Constructor Detail |
|---|
public CSVWriter(java.io.Writer writer)
CSVWriter.
writer - Writer used to write the data.
public CSVWriter(java.io.Writer writer,
char separator)
CSVWriter.
writer - Writer used to write the data.separator - Character used to separate the values.
public CSVWriter(java.io.Writer writer,
char separator,
char quotechar,
boolean autoquote)
CSVWriter.
writer - Writer used to write the data.separator - Character used to separate the values.quotechar - The character to use for quoted elementsautoquote - It allows the automatic quote in all the fields
public CSVWriter(java.io.Writer writer,
char separator,
char quotechar,
boolean[] selectedquotes)
CSVWriter.
writer - Writer used to write the data.separator - Character used to separate the values.quotechar - The character to use for quoted elementsselectedquotes - All fields mark as True are quoted.
public CSVWriter(java.io.Writer writer,
char separator,
char quotechar)
CSVWriter.
writer - Writer used to write the data.separator - Character used to separate the values.quotechar - The character to use for quoted elements| Method Detail |
|---|
public void writeNext(java.lang.String[] row)
throws java.io.IOException
writeNext in interface RowWriterrow - Row of data as a string array.
java.io.IOException - If bad things happen during the write.
public void close()
throws java.io.IOException
close in interface RowWriterjava.io.IOException - If the close fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||