Package com.opencsv.bean.concurrent
Class BeanExecutor<T>
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor<String[]>
com.opencsv.bean.concurrent.BeanExecutor<T>
- Type Parameters:
T
- The type of the bean being converted
- All Implemented Interfaces:
AutoCloseable
,Executor
,ExecutorService
,Spliterator<String[]>
A specific derivative of
IntolerantThreadPoolExecutor
intended for
submitting beans to be converted to String
s for writing.- Since:
- 5.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,
T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
Fields inherited from class com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor
accumulateThread, errorLocale, expectedRecords, resultQueue, thrownExceptionsQueue
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
ConstructorsConstructorDescriptionBeanExecutor
(boolean orderedResults, Locale errorLocale) The only constructor available for this class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
submitBean
(long lineNumber, MappingStrategy<T> mappingStrategy, T bean, CsvExceptionHandler exceptionHandler) Submit one bean for conversion.Methods inherited from class com.opencsv.bean.concurrent.IntolerantThreadPoolExecutor
afterExecute, characteristics, checkExceptions, complete, estimateSize, getCapturedExceptions, getTerminalException, prepare, shutdownNow, tryAdvance, trySplit
Methods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, terminated, toString
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.ExecutorService
close
Methods inherited from interface java.util.Spliterator
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
-
Constructor Details
-
BeanExecutor
The only constructor available for this class.- Parameters:
orderedResults
- Whether order should be preserved in the resultserrorLocale
- The locale to use for error messages
-
-
Method Details
-
submitBean
public void submitBean(long lineNumber, MappingStrategy<T> mappingStrategy, T bean, CsvExceptionHandler exceptionHandler) Submit one bean for conversion.- Parameters:
lineNumber
- Which record in the output file is being processedmappingStrategy
- The mapping strategy to be usedbean
- The bean to be transformed into a line of outputexceptionHandler
- The handler for exceptions thrown during record processing
-