net.sf.jmatchparser.util.csv
Class CSVWriter

java.lang.Object
  extended by net.sf.jmatchparser.util.csv.AbstractCSVWriter
      extended by net.sf.jmatchparser.util.csv.CSVWriter

public class CSVWriter
extends AbstractCSVWriter

Class to create CSV files.


Constructor Summary
CSVWriter(OutputStream out, String charsetName, char separator)
          Create a new CSV writer that writes tot he given stream in the given charset.
CSVWriter(Writer w, char separator)
          Create a new CSV writer that writes to the given Writer.
 
Method Summary
 void close()
          Close this CSV writer.
 void flush()
          Flush this CSV writer.
 char getSeparator()
          Get the separator character used by this CSV writer.
 void write(String... record)
          Write a record (line) into this CSV file, properly separating/quoting the fields as CSV requires.
 
Methods inherited from class net.sf.jmatchparser.util.csv.AbstractCSVWriter
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVWriter

public CSVWriter(Writer w,
                 char separator)
Create a new CSV writer that writes to the given Writer.

Parameters:
w - the writer to write to.

CSVWriter

public CSVWriter(OutputStream out,
                 String charsetName,
                 char separator)
          throws UnsupportedEncodingException
Create a new CSV writer that writes tot he given stream in the given charset.

Parameters:
out - Output stream
charsetName - charset
Throws:
UnsupportedEncodingException
Method Detail

flush

public void flush()
           throws IOException
Description copied from class: AbstractCSVWriter
Flush this CSV writer.

Specified by:
flush in class AbstractCSVWriter
Throws:
IOException

close

public void close()
           throws IOException
Description copied from class: AbstractCSVWriter
Close this CSV writer.

Specified by:
close in class AbstractCSVWriter
Throws:
IOException

getSeparator

public char getSeparator()
Get the separator character used by this CSV writer.


write

public void write(String... record)
           throws IOException
Write a record (line) into this CSV file, properly separating/quoting the fields as CSV requires.

Specified by:
write in class AbstractCSVWriter
Throws:
IOException


Copyright © 2011. All Rights Reserved.