Class ProcessCsvLine<T>
java.lang.Object
com.opencsv.bean.concurrent.ProcessCsvLine<T>
- Type Parameters:
T- The type of the bean being created
- All Implemented Interfaces:
Runnable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CsvExceptionHandlerprivate final CsvToBeanFilterprivate final String[]private final longprivate final MappingStrategy<? extends T> private final BlockingQueue<OrderedObject<T>> private final BlockingQueue<OrderedObject<CsvException>> private final List<BeanVerifier<T>> -
Constructor Summary
ConstructorsConstructorDescriptionProcessCsvLine(long lineNumber, MappingStrategy<? extends T> mapper, CsvToBeanFilter filter, List<BeanVerifier<T>> verifiers, String[] line, BlockingQueue<OrderedObject<T>> resultantBeanQueue, BlockingQueue<OrderedObject<CsvException>> thrownExceptionsQueue, SortedSet<Long> expectedRecords, CsvExceptionHandler exceptionHandler) The only constructor for creating a bean out of a line of input. -
Method Summary
-
Field Details
-
lineNumber
private final long lineNumber -
mapper
-
filter
-
verifiers
-
line
-
resultantBeanQueue
-
thrownExceptionsQueue
-
expectedRecords
-
exceptionHandler
-
-
Constructor Details
-
ProcessCsvLine
public ProcessCsvLine(long lineNumber, MappingStrategy<? extends T> mapper, CsvToBeanFilter filter, List<BeanVerifier<T>> verifiers, String[] line, BlockingQueue<OrderedObject<T>> resultantBeanQueue, BlockingQueue<OrderedObject<CsvException>> thrownExceptionsQueue, SortedSet<Long> expectedRecords, CsvExceptionHandler exceptionHandler) The only constructor for creating a bean out of a line of input.- Parameters:
lineNumber- Which record in the input file is being processedmapper- The mapping strategy to be usedfilter- A filter to remove beans from the running, if necessary. May be null.verifiers- The list of verifiers to run on beans after creationline- The line of input to be transformed into a beanresultantBeanQueue- A queue in which to place the bean createdthrownExceptionsQueue- A queue in which to place a thrown exception, if one is thrownexpectedRecords- 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 Details
-
run
-
processLine
private T processLine() throws CsvBeanIntrospectionException, CsvBadConverterException, CsvFieldAssignmentException, CsvChainedExceptionCreates a single object from a line from the CSV file.- Returns:
- Object containing the values.
- Throws:
CsvBeanIntrospectionException- Thrown on error creating bean.CsvBadConverterException- If a custom converter cannot be initialized properlyCsvFieldAssignmentException- A more specific subclass of this exception is thrown for any problem decoding and assigning a field of the input to a bean fieldCsvChainedException- If multiple exceptions are thrown for the same input line
-