Class ObjectRowListProcessor
java.lang.Object
com.univocity.parsers.common.DefaultConversionProcessor
com.univocity.parsers.common.processor.core.AbstractObjectProcessor<ParsingContext>
com.univocity.parsers.common.processor.core.AbstractObjectListProcessor<ParsingContext>
com.univocity.parsers.common.processor.ObjectRowListProcessor
- All Implemented Interfaces:
ConversionProcessor,Processor<ParsingContext>,RowProcessor
public class ObjectRowListProcessor
extends AbstractObjectListProcessor<ParsingContext>
implements RowProcessor
A convenience
RowProcessor implementation for storing all rows parsed and converted to Object arrays into a list.
A typical use case of this class will be:
ObjectRowListProcessor processor = new ObjectRowListProcessor(); processor.convertIndexes(Conversions.toBigDecimal()).set(4, 6); parserSettings.setRowProcessor(new ObjectRowListProcessor()); parser.parse(reader); // will invoke the {@link AbstractObjectListProcessor#rowProcessed(Object[], Context)} method for each parsed record. String[] headers = rowProcessor.getHeaders(); List<Object[]> rows = rowProcessor.getRows(); BigDecimal value1 = (BigDecimal) row.get(4); BigDecimal value2 = (BigDecimal) row.get(6);
- See Also:
-
Field Summary
Fields inherited from class com.univocity.parsers.common.DefaultConversionProcessor
conversions -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new processor ofObject[]rows with varying types.ObjectRowListProcessor(int expectedRowCount) Creates a new processor ofObject[]rows with varying types. -
Method Summary
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractObjectListProcessor
getHeaders, getRows, processEnded, processStarted, rowProcessedMethods inherited from class com.univocity.parsers.common.processor.core.AbstractObjectProcessor
rowProcessedMethods inherited from class com.univocity.parsers.common.DefaultConversionProcessor
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
-
Constructor Details
-
ObjectRowListProcessor
public ObjectRowListProcessor()Creates a new processor ofObject[]rows with varying types. -
ObjectRowListProcessor
public ObjectRowListProcessor(int expectedRowCount) Creates a new processor ofObject[]rows with varying types.- Parameters:
expectedRowCount- expected number of rows to be parsed from the input. Used to pre-allocate the size of the outputListreturned byAbstractObjectListProcessor.getRows()
-