Top Description Fields Constructors Methods
com.opencsv.bean.concurrent

public Class CompleteFileReader<T>

extends SingleLineReader
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Type Parameters
<T>
The type of bean being created
Imports
com.opencsv.CSVReader, com.opencsv.bean.BeanVerifier, .CsvToBeanFilter, .MappingStrategy, com.opencsv.bean.exceptionhandler.CsvExceptionHandler, org.apache.commons.lang3.ObjectUtils, java.util.Collections, .List

Implements a separate thread for reading input and siphoning it to a LineExecutor.
Author
Andrew Rucker Jones
Since
5.2

Field Summary

Modifier and TypeField and Description
private final CsvExceptionHandler
exceptionHandler

Whether exceptions in processing should be thrown or collected.

private LineExecutor<T>
executor

The executor that takes lines of input and converts them to beans.

private final CsvToBeanFilter
filter

Filter to be applied to the input.

private long
lineProcessed

Counts how many records have been read from the input.

private final MappingStrategy<? extends T>
mappingStrategy

The mapping strategy in use.

private Throwable
terminalException

The exception that brought execution to a grinding halt.

private final List<BeanVerifier<T>>
verifiers

Verifiers to be applied to the beans created.

Inherited from com.opencsv.bean.concurrent.SingleLineReader:
csvReaderignoreEmptyLinesline

Constructor Summary

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

Method Summary

Modifier and TypeMethod and Description
public long
getLineProcessed()

Returns: How many lines have been processed thus far

public Throwable
getTerminalException()

Returns: The exception that brought execution to a halt

public void
run()

Implements java.lang.Runnable.run.

Runs a nice, tight loop to simply read input and submit for conversion.

public void
setExecutor(LineExecutor<T>
The executor to use
executor
)

Sets the executor that will convert text input to bean output.

Inherited from com.opencsv.bean.concurrent.SingleLineReader:
getLinegetLinesReadreadNextLine

Field Detail

exceptionHandlerback to summary
private final CsvExceptionHandler exceptionHandler

Whether exceptions in processing should be thrown or collected.

executorback to summary
private LineExecutor<T> executor

The executor that takes lines of input and converts them to beans.

filterback to summary
private final CsvToBeanFilter filter

Filter to be applied to the input.

lineProcessedback to summary
private long lineProcessed

Counts how many records have been read from the input.

mappingStrategyback to summary
private final MappingStrategy<? extends T> mappingStrategy

The mapping strategy in use.

terminalExceptionback to summary
private Throwable terminalException

The exception that brought execution to a grinding halt.

verifiersback to summary
private final List<BeanVerifier<T>> verifiers

Verifiers to be applied to the beans created.

Constructor Detail

CompleteFileReaderback to summary
public CompleteFileReader(CSVReader csvReader, CsvToBeanFilter filter, boolean ignoreEmptyLines, MappingStrategy<? extends T> mappingStrategy, CsvExceptionHandler exceptionHandler, List<BeanVerifier<T>> verifiers)
Parameters
csvReader:CSVReader

The CSVReader from which input is read

filter:CsvToBeanFilter

Filter to be applied to the input

ignoreEmptyLines:boolean

Whether empty lines of input should be ignored

mappingStrategy:MappingStrategy<? extends T>

The mapping strategy in use

exceptionHandler:CsvExceptionHandler

Determines the exception handling behavior

verifiers:List<BeanVerifier<T>>

Verifiers to be applied to the beans created

Method Detail

getLineProcessedback to summary
public long getLineProcessed()
Returns:long

How many lines have been processed thus far

getTerminalExceptionback to summary
public Throwable getTerminalException()
Returns:Throwable

The exception that brought execution to a halt

runback to summary
public void run()

Implements java.lang.Runnable.run.

Runs a nice, tight loop to simply read input and submit for conversion.

Annotations
@Override
setExecutorback to summary
public void setExecutor(LineExecutor<T> executor)

Sets the executor that will convert text input to bean output.

Parameters
executor:LineExecutor<T>

The executor to use