nl.lxtreme.ols.util.export
Class CsvExporterImpl

java.lang.Object
  extended by nl.lxtreme.ols.util.export.CsvExporterImpl
All Implemented Interfaces:
ExportUtils.CsvExporter

public class CsvExporterImpl
extends Object
implements ExportUtils.CsvExporter

Provides a CSV exporter implementation.


Constructor Summary
CsvExporterImpl(File aFile)
          Creates a new CsvExporterImpl instance.
CsvExporterImpl(File aFile, char aDelimiter)
          Creates a new CsvExporterImpl instance.
 
Method Summary
 void addRow(Object... aValues)
          Adds a new row with cell values to the CSV output.
 void close()
          Closes this exporter.
 void setHeaders(String... aHeaders)
          Sets the headers of the CSV file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvExporterImpl

public CsvExporterImpl(File aFile)
                throws IOException
Creates a new CsvExporterImpl instance.

Parameters:
aFile - the file to export to, cannot be null.
Throws:
IOException - in case of I/O exceptions.

CsvExporterImpl

public CsvExporterImpl(File aFile,
                       char aDelimiter)
                throws IOException
Creates a new CsvExporterImpl instance.

Parameters:
aFile - the file to export to, cannot be null;
aDelimiter - the CSV delimiter to use.
Throws:
IOException - in case of I/O exceptions.
Method Detail

addRow

public void addRow(Object... aValues)
            throws IOException
Adds a new row with cell values to the CSV output.

Specified by:
addRow in interface ExportUtils.CsvExporter
Parameters:
aValues - the cell values to write in this row.
Throws:
IOException - in case of I/O problems.

close

public void close()
           throws IOException
Closes this exporter.

Specified by:
close in interface ExportUtils.CsvExporter
Throws:
IOException - in case of I/O problems.

setHeaders

public void setHeaders(String... aHeaders)
                throws IOException
Sets the headers of the CSV file.

Specified by:
setHeaders in interface ExportUtils.CsvExporter
Parameters:
aHeaders - the array of header names.
Throws:
IOException - in case of I/O problems.


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.