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

public class CompleteFileReader<T> extends SingleLineReader implements Runnable
Implements a separate thread for reading input and siphoning it to a LineExecutor.
Since:
5.2
Author:
Andrew Rucker Jones
  • Constructor Details

    • CompleteFileReader

      public CompleteFileReader(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, List<BeanVerifier<T>> verifiers)
      Parameters:
      csvReader - The CSVReader from which input is read
      filter - Filter to be applied to the input
      ignoreEmptyLines - Whether empty lines of input should be ignored
      mappingStrategy - The mapping strategy in use
      exceptionHandler - Determines the exception handling behavior
      verifiers - Verifiers to be applied to the beans created
  • Method Details

    • getTerminalException

      public 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:
      run in interface Runnable