Processor 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 getColumnValuesAsList(),
getColumnValuesAsMapOfIndexes() and getColumnValuesAsMapOfNames().
Note
Storing the values of all columns may be memory intensive. For large inputs, use a AbstractBatchedObjectColumnProcessor instead
AbstractParser, Processor, ColumnReader, Conversion, AbstractObjectProcessor
| Modifier and Type | Field and Description |
|---|---|
| private final ColumnSplitter |
| Access | Constructor and Description |
|---|---|
| public | |
| public | AbstractObjectColumnProcessor(int
the expected number of rows to be processed expectedRowCount)Constructs a column processor pre-allocating room for the expected number of rows to be processed |
| Modifier and Type | Method and Description |
|---|---|
| public < the type of data in that column V> List | |
| public < the type of data in that column V> List | |
| public List | getColumn(String
the name of the column in the input. columnName)Implements com. |
| public List | getColumn(int
the position of the column in the input (0-based). columnIndex)Implements com. |
| public final List | getColumnValuesAsList()
Implements com. |
| public final Map | getColumnValuesAsMapOfIndexes()
Implements com. |
| public final Map | getColumnValuesAsMapOfNames()
Implements com. |
| public final String[] | getHeaders()
Implements com. |
| public void | processStarted(T
A contextual object with information and controls over the current state of the parsing process context)Overrides com. Implements com. |
| public final void | putColumnValuesInMapOfIndexes(Map<Integer, List<Object>>
the map to hold the values of each column map)Implements com. |
| public final void | putColumnValuesInMapOfNames(Map<String, List<Object>>
the map to hold the values of each column map)Implements com. |
| public void | rowProcessed(Object[]
object array created with the information extracted by the parser and then converted. row, T A contextual object with information and controls over the current state of the parsing process context)Implements abstract com. |
| splitter | back to summary |
|---|---|
| private final ColumnSplitter<Object> splitter | |
| AbstractObjectColumnProcessor | back to summary |
|---|---|
| public AbstractObjectColumnProcessor() Constructs a column processor, pre-allocating room for 1000 rows. | |
| AbstractObjectColumnProcessor | back to summary |
|---|---|
| public AbstractObjectColumnProcessor(int expectedRowCount) Constructs a column processor pre-allocating room for the expected number of rows to be processed
| |
| getColumn | back to summary |
|---|---|
| public <V> List Returns the values of a given column. | |
| getColumn | back to summary |
|---|---|
| public <V> List Returns the values of a given column. | |
| getColumn | back to summary |
|---|---|
| public List Implements com. Doc from com. Returns the values of a given column. | |
| getColumn | back to summary |
|---|---|
| public List Implements com. Doc from com. Returns the values of a given column. | |
| getColumnValuesAsList | back to summary |
|---|---|
| public final List Implements com. Doc from com. Returns the values processed for each column | |
| getColumnValuesAsMapOfIndexes | back to summary |
|---|---|
| public final Map Implements com. Doc from com. Returns a map of column indexes and their respective list of values parsed from the input. | |
| getColumnValuesAsMapOfNames | back to summary |
|---|---|
| public final Map Implements com. Doc from com. Returns a map of column names and their respective list of values parsed from the input. | |
| getHeaders | back to summary |
|---|---|
| public final String[] getHeaders() Implements com. Doc from com. Returns the column headers. This can be either the headers defined in | |
| processStarted | back to summary |
|---|---|
| public void processStarted(T context) Overrides com. Implements com. Doc from com. This method will by invoked by the parser once, when it is ready to start processing the input.
| |
| putColumnValuesInMapOfIndexes | back to summary |
|---|---|
| public final void putColumnValuesInMapOfIndexes(Map<Integer, List<Object>> map) Implements com. Doc from com. Fills a given map associating each column index to its list of values | |
| putColumnValuesInMapOfNames | back to summary |
|---|---|
| public final void putColumnValuesInMapOfNames(Map<String, List<Object>> map) Implements com. Doc from com. Fills a given map associating each column name to its list o values | |
| rowProcessed | back to summary |
|---|---|
| public void rowProcessed(Object[] row, T context) Implements abstract com. Doc from com. Invoked by the processor after all values of a valid record have been processed and converted into an Object array. | |