Class CsvParserContext

java.lang.Object
com.illumon.iris.importers.csv.parsers.CsvParserContext

public class CsvParserContext
extends Object
Context class that holds the attributes and functionality common to all custom parsers
  • Constructor Details

    • CsvParserContext

      public CsvParserContext​(@NotNull com.fishlib.io.logger.Logger log, @NotNull AtomicInteger errorCount, @NotNull String arrayDelimiter, int maxError, boolean strict)
      Parameters:
      log - The passed-down logger
      arrayDelimiter - Delimiter used for array parsing
      strict - Whether to fail if a field fails conversion
      maxError - Maximum number of field conversion failures allowed
      errorCount - Holds the current error count across all parsers being used to import csv
  • Method Details

    • getLog

      public com.fishlib.io.logger.Logger getLog()
    • getErrorCount

      public AtomicInteger getErrorCount()
    • getArrayDelimiter

      public String getArrayDelimiter()
    • getMaxError

      public int getMaxError()
    • isStrict

      public boolean isStrict()
    • recordError

      public void recordError​(@NotNull String errorMessage, boolean failDefault) throws io.deephaven.csv.util.CsvReaderException
      Adds the CsvReaderException to internal queue. The first exception in queue is thrown if maxError limit is breached.
      Parameters:
      errorMessage - The error message to be thrown in the exception
      failDefault - Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value fails
      Throws:
      io.deephaven.csv.util.CsvReaderException