Class CSVProcessor

  • All Implemented Interfaces:
    ReportProcessor

    public class CSVProcessor
    extends AbstractReportProcessor
    The CSVProcessor coordinates the writing process for the raw CSV output.

    A CSVWriter is added to the private copy of the report to handle the output process.

    Author:
    Thomas Morgner
    • Constructor Detail

      • CSVProcessor

        public CSVProcessor​(MasterReport report)
                     throws ReportProcessingException
        Creates a new CSVProcessor. The processor will use a comma (",") to separate the column values, unless defined otherwise in the report configuration. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. DataRow names are not written.
        Parameters:
        report - the report to be processed.
        Throws:
        ReportProcessingException - if the report initialisation failed.
      • CSVProcessor

        public CSVProcessor​(MasterReport report,
                            String separator)
                     throws ReportProcessingException
        Creates a new CSVProcessor. The processor will use the specified separator, the report configuration is not queried for a separator. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. DataRowNames are not written.
        Parameters:
        report - the report to be processed.
        separator - the separator string to mark column boundaries.
        Throws:
        ReportProcessingException - if the report initialisation failed.
      • CSVProcessor

        public CSVProcessor​(MasterReport report,
                            String separator,
                            boolean writeDataRowNames)
                     throws ReportProcessingException
        Creates a new CSVProcessor. The processor will use the specified separator, the report configuration is not queried for a separator. The processor creates a private copy of the clone, so that no change to the original report will influence the report processing. The first row will contain the datarow names.
        Parameters:
        report - the report to be processed.
        separator - the separator string to mark column boundaries.
        writeDataRowNames - controls whether or not the data row names are output.
        Throws:
        ReportProcessingException - if the report initialisation failed.
    • Method Detail

      • getWriter

        public Writer getWriter()
        Returns the writer used in this Processor.
        Returns:
        the writer
      • setWriter

        public void setWriter​(Writer writer)
        Defines the writer which should be used to write the contents of the report.
        Parameters:
        writer - the writer.
      • isStrictErrorHandling

        protected static boolean isStrictErrorHandling​(org.pentaho.reporting.libraries.base.config.Configuration config)
        Deprecated.
        No longer needed.
        Checks whether report processing should be aborted when an exception occurs.
        Parameters:
        config - the configuration.
        Returns:
        if strict error handling is enabled.