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

public Class LineExecutor<T>

extends IntolerantThreadPoolExecutor<T>
Class Inheritance
Type Parameters
<T>
The type of the bean being converted to
Imports
com.opencsv.ICSVParser, com.opencsv.bean.BeanVerifier, .CsvToBeanFilter, .MappingStrategy, com.opencsv.bean.exceptionhandler.CsvExceptionHandler, com.opencsv.exceptions.CsvMalformedLineException, java.util.Arrays, .List, .Locale, .ResourceBundle, java.util.concurrent.RejectedExecutionException

A specific derivative of IntolerantThreadPoolExecutor intended for submitting lines of input to be converted to beans.
Author
Andrew Rucker Jones
Since
5.0

Field Summary

Modifier and TypeField and Description
private final CompleteFileReader<T>
Inherited from com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor:
accumulateThreaderrorLocaleexpectedRecordsresultQueuethrownExceptionsQueue

Constructor Summary

AccessConstructor and Description
public
LineExecutor(boolean
Whether order should be preserved in the results
orderedResults
,
Locale
The locale to use for error messages
errorLocale
,
CompleteFileReader<T>
The thread that reads lines of input and feeds the results to this Executor
completeFileReader
)

The only constructor available for this class.

Method Summary

Modifier and TypeMethod and Description
protected void
checkExceptions()

Overrides com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.checkExceptions.

Checks whether exceptions are available that should halt processing.

public void
prepare()

Overrides com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.prepare.

Prepares this Executor to receive jobs.

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

Submit one record for conversion to a bean.

Inherited from com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor:
afterExecutecharacteristicscompleteestimateSizegetCapturedExceptionsgetTerminalExceptionshutdownNowtryAdvancetrySplit

Field Detail

completeFileReaderback to summary
private final CompleteFileReader<T> completeFileReader

Constructor Detail

LineExecutorback to summary
public LineExecutor(boolean orderedResults, Locale errorLocale, CompleteFileReader<T> completeFileReader)

The only constructor available for this class.

Parameters
orderedResults:boolean

Whether order should be preserved in the results

errorLocale:Locale

The locale to use for error messages

completeFileReader:CompleteFileReader<T>

The thread that reads lines of input and feeds the results to this Executor

Method Detail

checkExceptionsback to summary
protected void checkExceptions()

Overrides com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.checkExceptions.

Doc from com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.checkExceptions.

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.

Annotations
@Override
prepareback to summary
public void prepare()

Overrides com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.prepare.

Doc from com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor.prepare.

Prepares this Executor to receive jobs.

Annotations
@Override
submitLineback to summary
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:long

Which record in the input file is being processed

mapper:MappingStrategy<? extends T>

The mapping strategy to be used

filter:CsvToBeanFilter

A filter to remove beans from the running, if necessary. May be null.

verifiers:List<BeanVerifier<T>>

The list of verifiers to run on beans after creation

line:String[]

The line of input to be transformed into a bean

exceptionHandler:CsvExceptionHandler

The handler for exceptions thrown during record processing