|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.skife.csv.SimpleWriter
Provides primitive support for writing CSV files.
Constructor Summary | |
SimpleWriter(java.io.Writer out)
Create a CSVWriter which prints output to a Writer . |
Method Summary | |
static void |
append(java.io.File file,
WriterCallback callback)
Open a file and pass a writer to the callback which appends to that file. |
void |
append(java.lang.Object[] fields)
Write a row to the CSV file |
void |
rawLine(java.lang.String line)
Append a string as a raw line, without any processing |
void |
setAutoFlush(boolean autoFlush)
Flush after each line? Default is false |
void |
setNewLine(char c)
Defaults to the system dependent newline |
void |
setNewLine(char[] c)
Defaults to the system dependent newline |
void |
setNewLine(java.lang.String newline)
Defaults to the system dependent newline |
void |
setQuoteCharacters(char[] quotes)
Specify an array of chars that will be treated as quotes, ie, will be ignored and everything between them is one field. |
void |
setSeperator(char seperator)
Specify the character to use to seperate fields, defaults to a comma |
static void |
write(java.io.File file,
WriterCallback callback)
Open a file and pass a writer to the callback which creates or overwrites that file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleWriter(java.io.Writer out)
Writer
. It does not close
the Writer.
Method Detail |
public void append(java.lang.Object[] fields) throws java.io.IOException
append
in interface CSVWriter
java.io.IOException
public void rawLine(java.lang.String line) throws java.io.IOException
Useful for comments, etc
rawLine
in interface CSVWriter
java.io.IOException
public void setSeperator(char seperator)
setSeperator
in interface CSVWriter
public void setAutoFlush(boolean autoFlush)
setAutoFlush
in interface CSVWriter
public void setNewLine(char c)
setNewLine
in interface CSVWriter
public void setNewLine(char[] c)
setNewLine
in interface CSVWriter
public void setNewLine(java.lang.String newline)
setNewLine
in interface CSVWriter
public void setQuoteCharacters(char[] quotes)
public static void write(java.io.File file, WriterCallback callback)
java.lang.RuntimeException
- if there is an exception during execution, flushing, or closing the filepublic static void append(java.io.File file, WriterCallback callback)
java.lang.RuntimeException
- if there is an exception during execution, flushing, or closing the file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |