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:
java.lang.Runnable
public class CompleteFileReader<T> extends SingleLineReader implements java.lang.Runnable
Implements a separate thread for reading input and siphoning it to aLineExecutor.- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description private CsvExceptionHandlerexceptionHandlerWhether exceptions in processing should be thrown or collected.private LineExecutor<T>executorThe executor that takes lines of input and converts them to beans.private CsvToBeanFilterfilterFilter to be applied to the input.private longlineProcessedCounts how many records have been read from the input.private MappingStrategy<? extends T>mappingStrategyThe mapping strategy in use.private java.lang.ThrowableterminalExceptionThe exception that brought execution to a grinding halt.private java.util.List<BeanVerifier<T>>verifiersVerifiers to be applied to the beans created.-
Fields inherited from class com.opencsv.bean.concurrent.SingleLineReader
csvReader, ignoreEmptyLines, line
-
-
Constructor Summary
Constructors Constructor Description CompleteFileReader(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, java.util.List<BeanVerifier<T>> verifiers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetLineProcessed()java.lang.ThrowablegetTerminalException()voidrun()Runs a nice, tight loop to simply read input and submit for conversion.voidsetExecutor(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 Detail
-
filter
private final CsvToBeanFilter filter
Filter to be applied to the input.
-
mappingStrategy
private final MappingStrategy<? extends T> mappingStrategy
The mapping strategy in use.
-
exceptionHandler
private final CsvExceptionHandler exceptionHandler
Whether exceptions in processing should be thrown or collected.
-
verifiers
private final java.util.List<BeanVerifier<T>> verifiers
Verifiers to be applied to the beans created.
-
lineProcessed
private long lineProcessed
Counts how many records have been read from the input.
-
terminalException
private java.lang.Throwable terminalException
The exception that brought execution to a grinding halt.
-
executor
private LineExecutor<T> executor
The executor that takes lines of input and converts them to beans.
-
-
Constructor Detail
-
CompleteFileReader
public CompleteFileReader(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, java.util.List<BeanVerifier<T>> verifiers)
- Parameters:
csvReader- TheCSVReaderfrom 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 Detail
-
getTerminalException
public java.lang.Throwable getTerminalException()
- Returns:
- The exception that brought execution to a halt
-
getLineProcessed
public long getLineProcessed()
- Returns:
- How many lines have been processed thus far
-
setExecutor
public void setExecutor(LineExecutor<T> executor)
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.- Specified by:
runin interfacejava.lang.Runnable
-
-