Class TabularParserHelper


  • public class TabularParserHelper
    extends Object
    • Constructor Detail

      • TabularParserHelper

        public TabularParserHelper()
    • Method Detail

      • createParserUIInitializationData

        public com.fasterxml.jackson.databind.node.ObjectNode createParserUIInitializationData​(com.fasterxml.jackson.databind.node.ObjectNode options)
      • parseOneFile

        public static Grid parseOneFile​(Runner runner,
                                        String fileSource,
                                        String archiveFileName,
                                        CloseableIterable<Row> dataReader,
                                        long limit,
                                        com.fasterxml.jackson.databind.node.ObjectNode options)
        Parse a grid from a stream of rows, handling the generic processing generally available in tabular importers. This covers column name extraction from header rows, blank cell and row handling, datatype detection and addition of columns for archive and file sources. This function will do one pass over the entire grid before returning the Grid object, counting its rows and normalizing all rows to have the same number of cells.
        Parameters:
        runner - the runner to use to create the grid
        fileSource - the name of the file this is parsed from
        archiveFileName - the name of the zip archive the file comes from
        dataReader - the iterable of rows for the grid
        limit - the maximum number of rows to store in the grid (not counting headers and skipped rows)
        options - a map of parsing options
      • prependColumn

        public static Grid prependColumn​(String columnName,
                                         String cellValue,
                                         Grid grid)
        Adds a column to the grid, with the same string content in all cells. The column is added at the beginning of the grid.
        Parameters:
        columnName - the name of the column to add
        cellValue - the constant value in this column
        grid - the original grid to start from
        Returns:
        a modified copy of the grid