Class ObjectColumnProcessor
java.lang.Object
com.univocity.parsers.common.DefaultConversionProcessor
com.univocity.parsers.common.processor.core.AbstractObjectProcessor<T>
com.univocity.parsers.common.processor.core.AbstractObjectColumnProcessor<ParsingContext>
com.univocity.parsers.common.processor.ObjectColumnProcessor
- All Implemented Interfaces:
ConversionProcessor
,ColumnReader<Object>
,Processor<ParsingContext>
,RowProcessor
public class ObjectColumnProcessor
extends AbstractObjectColumnProcessor<ParsingContext>
implements RowProcessor
A
RowProcessor
implementation for converting rows extracted from any implementation of AbstractParser
into columns of objects.
This uses the value conversions provided by Conversion
instances.
For each row processed, a sequence of conversions will be executed to generate the appropriate object. Each resulting object will then be stored in a list that contains the values of the corresponding column.
At the end of the process, the user can access the lists with values parsed for all columns using the methods AbstractObjectColumnProcessor.getColumnValuesAsList()
,
AbstractObjectColumnProcessor.getColumnValuesAsMapOfIndexes()
and AbstractObjectColumnProcessor.getColumnValuesAsMapOfNames()
.
Note: Storing the values of all columns may be memory intensive. For large inputs, use a BatchedObjectColumnProcessor
instead
- See Also:
-
Field Summary
Fields inherited from class com.univocity.parsers.common.DefaultConversionProcessor
conversions
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a column processor, pre-allocating room for 1000 rows.ObjectColumnProcessor
(int expectedRowCount) Constructs a column processor pre-allocating room for the expected number of rows to be processed -
Method Summary
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractObjectColumnProcessor
getColumn, getColumn, getColumn, getColumn, getColumnValuesAsList, getColumnValuesAsMapOfIndexes, getColumnValuesAsMapOfNames, getHeaders, processStarted, putColumnValuesInMapOfIndexes, putColumnValuesInMapOfNames, rowProcessed
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractObjectProcessor
processEnded, rowProcessed
Methods inherited from class com.univocity.parsers.common.DefaultConversionProcessor
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
-
Constructor Details
-
ObjectColumnProcessor
public ObjectColumnProcessor()Constructs a column processor, pre-allocating room for 1000 rows. -
ObjectColumnProcessor
public ObjectColumnProcessor(int expectedRowCount) Constructs a column processor pre-allocating room for the expected number of rows to be processed- Parameters:
expectedRowCount
- the expected number of rows to be processed
-