Class RowListProcessor

All Implemented Interfaces:
Processor<ParsingContext>, RowProcessor

public class RowListProcessor extends AbstractListProcessor<ParsingContext> implements RowProcessor
A convenience RowProcessor implementation for storing all rows parsed into a list. A typical use case of this class will be:

 parserSettings.setRowProcessor(new RowListProcessor());
 parser.parse(reader); // will invoke the RowProcessor.rowProcessed(String[], ParsingContext) method for each parsed record.

 String[] headers = rowProcessor.getHeaders();
 List<String[]> rows = rowProcessor.getRows();

 

  • Constructor Details

    • RowListProcessor

      public RowListProcessor()
      Creates a new processor of String[] rows.
    • RowListProcessor

      public RowListProcessor(int expectedRowCount)
      Creates a new processor of String[] rows.
      Parameters:
      expectedRowCount - expected number of rows to be parsed from the input. Used to pre-allocate the size of the output List returned by AbstractListProcessor.getRows()