Class CSVExport

java.lang.Object
com.jbstrap.core.data.DataExporter
com.jbstrap.core.data.export.CSVExport

public class CSVExport extends DataExporter

This class handles the exporting of data into a textual format (CSV Exporting class)

Since:
4.0
Author:
JBStrap
  • Field Details

  • Constructor Details

    • CSVExport

      public CSVExport(Parameters params)
      Creates a CSVExport instance with the specified export settings (parameters). Parameters are described in the Exportable interface.
      Parameters:
      params - Additional CSVExport parameters
      Parameter name Parameter value Default parameter value Parameter description
      separator* Char ',' Column separator character
  • Method Details

    • start

      public boolean start()
      Starts the CSV export process. The CSVWriter object is created and the CSV header is written into the CSV file.
      Specified by:
      start in class DataExporter
      Returns:
      Successful source creation
    • process

      public boolean process(List<Record> data)
      Writes the queried records into a CSVWriter object.
      Specified by:
      process in class DataExporter
      Parameters:
      data - Records retrieved using lazy fetch
      Returns:
      Successful record processing
    • end

      public byte[] end() throws IOException
      Export completed, no more records to be processed. Closes the created sources and returns them in a byte array.
      Specified by:
      end in class DataExporter
      Returns:
      Export successful
      Throws:
      IOException - An exception is thrown while handling a source