Class LineExecutor<T>

Type Parameters:
T - The type of the bean being converted to
All Implemented Interfaces:
AutoCloseable, Executor, ExecutorService, Spliterator<T>

public class LineExecutor<T> extends IntolerantThreadPoolExecutor<T>
A specific derivative of IntolerantThreadPoolExecutor intended for submitting lines of input to be converted to beans.
Since:
5.0
  • Field Details

  • Constructor Details

    • LineExecutor

      public LineExecutor(boolean orderedResults, Locale errorLocale, CompleteFileReader<T> completeFileReader)
      The only constructor available for this class.
      Parameters:
      orderedResults - Whether order should be preserved in the results
      errorLocale - The locale to use for error messages
      completeFileReader - The thread that reads lines of input and feeds the results to this Executor
  • Method Details

    • prepare

      public void prepare()
      Description copied from class: IntolerantThreadPoolExecutor
      Prepares this Executor to receive jobs.
      Overrides:
      prepare in class IntolerantThreadPoolExecutor<T>
    • checkExceptions

      protected void checkExceptions()
      Description copied from class: IntolerantThreadPoolExecutor
      Checks whether exceptions are available that should halt processing. This is the case with unrecoverable errors, such as parsing the input, or if exceptions in conversion should be thrown by request of the user.
      Overrides:
      checkExceptions in class IntolerantThreadPoolExecutor<T>
    • submitLine

      public void submitLine(long lineNumber, MappingStrategy<? extends T> mapper, CsvToBeanFilter filter, List<BeanVerifier<T>> verifiers, String[] line, CsvExceptionHandler exceptionHandler)
      Submit one record for conversion to a bean.
      Parameters:
      lineNumber - Which record in the input file is being processed
      mapper - The mapping strategy to be used
      filter - A filter to remove beans from the running, if necessary. May be null.
      verifiers - The list of verifiers to run on beans after creation
      line - The line of input to be transformed into a bean
      exceptionHandler - The handler for exceptions thrown during record processing