Package com.opencsv.bean.concurrent
Class CompleteFileReader<T>
java.lang.Object
com.opencsv.bean.concurrent.SingleLineReader
com.opencsv.bean.concurrent.CompleteFileReader<T>
- Type Parameters:
T
- The type of bean being created
- All Implemented Interfaces:
Runnable
Implements a separate thread for reading input and siphoning it to a
LineExecutor
.- Since:
- 5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CsvExceptionHandler
Whether exceptions in processing should be thrown or collected.private LineExecutor
<T> The executor that takes lines of input and converts them to beans.private final CsvToBeanFilter
Filter to be applied to the input.private long
Counts how many records have been read from the input.private final MappingStrategy
<? extends T> The mapping strategy in use.private Throwable
The exception that brought execution to a grinding halt.private final List
<BeanVerifier<T>> Verifiers to be applied to the beans created.Fields inherited from class com.opencsv.bean.concurrent.SingleLineReader
csvReader, ignoreEmptyLines, line
-
Constructor Summary
ConstructorsConstructorDescriptionCompleteFileReader
(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, List<BeanVerifier<T>> verifiers) -
Method Summary
Modifier and TypeMethodDescriptionlong
void
run()
Runs a nice, tight loop to simply read input and submit for conversion.void
setExecutor
(LineExecutor<T> executor) Sets the executor that will convert text input to bean output.Methods inherited from class com.opencsv.bean.concurrent.SingleLineReader
getLine, getLinesRead, readNextLine
-
Field Details
-
filter
Filter to be applied to the input. -
mappingStrategy
The mapping strategy in use. -
exceptionHandler
Whether exceptions in processing should be thrown or collected. -
verifiers
Verifiers to be applied to the beans created. -
lineProcessed
private long lineProcessedCounts how many records have been read from the input. -
terminalException
The exception that brought execution to a grinding halt. -
executor
The executor that takes lines of input and converts them to beans.
-
-
Constructor Details
-
CompleteFileReader
public CompleteFileReader(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, List<BeanVerifier<T>> verifiers) - Parameters:
csvReader
- TheCSVReader
from which input is readfilter
- Filter to be applied to the inputignoreEmptyLines
- Whether empty lines of input should be ignoredmappingStrategy
- The mapping strategy in useexceptionHandler
- Determines the exception handling behaviorverifiers
- Verifiers to be applied to the beans created
-
-
Method Details
-
getTerminalException
- Returns:
- The exception that brought execution to a halt
-
getLineProcessed
public long getLineProcessed()- Returns:
- How many lines have been processed thus far
-
setExecutor
Sets the executor that will convert text input to bean output.- Parameters:
executor
- The executor to use
-
run
public void run()Runs a nice, tight loop to simply read input and submit for conversion.
-