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 Summary
Constructors Constructor Description CsvParserContext(com.fishlib.io.logger.Logger log, AtomicInteger errorCount, String arrayDelimiter, int maxError, boolean strict)
-
Method Summary
Modifier and Type Method Description String
getArrayDelimiter()
AtomicInteger
getErrorCount()
com.fishlib.io.logger.Logger
getLog()
int
getMaxError()
boolean
isStrict()
void
recordError(String errorMessage, boolean failDefault)
Adds the CsvReaderException to internal queue.
-
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 loggerarrayDelimiter
- Delimiter used for array parsingstrict
- Whether to fail if a field fails conversionmaxError
- Maximum number of field conversion failures allowederrorCount
- Holds the current error count across all parsers being used to import csv
-
-
Method Details
-
getLog
public com.fishlib.io.logger.Logger getLog() -
getErrorCount
-
getArrayDelimiter
-
getMaxError
public int getMaxError() -
isStrict
public boolean isStrict() -
recordError
public void recordError(@NotNull String errorMessage, boolean failDefault) throws io.deephaven.csv.util.CsvReaderExceptionAdds 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 exceptionfailDefault
- Whether (true) to use the default value (onEmpty) if parsing/conversion of the source value fails- Throws:
io.deephaven.csv.util.CsvReaderException
-