|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tbee.csv.CSVFileWriter
public class CSVFileWriter
This class provides file level access to write CSV files.
It requires an output stream.
The default line separator is per default a newline (\n) but can be set prior to parsing.
The field separator can be set in the StringParser using getStringParser().
The parser recognizes comment lines if the first character in a line is a comment marker, default (#).
The first line may contain header information. In this case the identifiers are used in the map.
The file parsers counts the lines it has parsed according to the line separator.
| Field Summary | |
|---|---|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
CSVFileWriter()
Just the basic constructor Note that a OutputStream must be set before the parse method is called |
|
CSVFileWriter(OutputStream pOutputStream)
Usually there is a stream that is parsed This need not be a file OutputStream |
|
| Method Summary | |
|---|---|
void |
addComment(String pComment)
Add comments to the output |
void |
appendField(String pValue)
Add a field to the current line |
void |
commitLine()
Add the line to the output |
char |
getComment()
|
char |
getEscaper()
|
char |
getFieldSeparator()
|
long |
getLineNumber()
|
String |
getLineSeparator()
|
OutputStream |
getOutputStream()
|
void |
setComment(char pComment)
|
void |
setEscaper(char pEscaper)
|
void |
setFieldSeparator(char pSeparator)
|
void |
setLineSeparator(String pSeparator)
|
void |
setOutputStream(OutputStream pOutputStream)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
| Constructor Detail |
|---|
public CSVFileWriter()
public CSVFileWriter(OutputStream pOutputStream)
| Method Detail |
|---|
public void setLineSeparator(String pSeparator)
public String getLineSeparator()
public void setComment(char pComment)
public char getComment()
public void setFieldSeparator(char pSeparator)
public char getFieldSeparator()
public void setEscaper(char pEscaper)
public char getEscaper()
public void setOutputStream(OutputStream pOutputStream)
public OutputStream getOutputStream()
public long getLineNumber()
public void appendField(String pValue)
throws IOException
IOException
public void commitLine()
throws IOException
IOException
public void addComment(String pComment)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||