Class ProcessCsvBean<T>

  • Type Parameters:
    T - The type of the bean to be processed
    All Implemented Interfaces:
    java.lang.Runnable

    public class ProcessCsvBean<T>
    extends java.lang.Object
    implements java.lang.Runnable
    A class for converting one bean into its string representation for writing to an output.
    Since:
    4.0
    • Field Detail

      • lineNumber

        private final long lineNumber
      • bean

        private final T bean
      • resultantLineQueue

        private final java.util.concurrent.BlockingQueue<OrderedObject<java.lang.String[]>> resultantLineQueue
      • expectedRecords

        private final java.util.SortedSet<java.lang.Long> expectedRecords
    • Constructor Detail

      • ProcessCsvBean

        public ProcessCsvBean​(long lineNumber,
                              MappingStrategy<T> mappingStrategy,
                              T bean,
                              java.util.concurrent.BlockingQueue<OrderedObject<java.lang.String[]>> resultantLineQueue,
                              java.util.concurrent.BlockingQueue<OrderedObject<CsvException>> thrownExceptionsQueue,
                              java.util.SortedSet<java.lang.Long> expectedRecords,
                              CsvExceptionHandler exceptionHandler)
        The only constructor for creating a line of CSV output out of a bean.
        Parameters:
        lineNumber - Which record in the output file is being processed
        mappingStrategy - The mapping strategy to be used
        bean - The bean to be transformed into a line of output
        resultantLineQueue - A queue in which to place the line created
        thrownExceptionsQueue - A queue in which to place a thrown exception, if one is thrown
        expectedRecords - A list of outstanding record numbers so gaps in ordering due to filtered input or exceptions while converting can be detected.
        exceptionHandler - The handler for exceptions thrown during record processing
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable