Processor implementation for storing all rows parsed into a list.
A typical use case of this class will be:
parserSettings.setRowProcessor(new RowListProcessor()); parser.parse(reader); // will invoke theAbstractListProcessor#rowProcessed(String[], Context)method for each parsed record. String[] headers = rowProcessor.getHeaders(); List<String[]> rows = rowProcessor.getRows();
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private String[] | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | |
| public List | |
| public void | processEnded(T
A contextual object with information and controls over the state of the parsing process context)Implements com. |
| public void | processStarted(T
A contextual object with information and controls over the current state of the parsing process context)Implements com. |
| public void | rowProcessed(String[]
the data extracted by the parser for an individual record. Note that:
row, T
A contextual object with information and controls over the current state of the parsing process context)Implements com. |
| expectedRowCount | back to summary |
|---|---|
| private final int expectedRowCount | |
| headers | back to summary |
|---|---|
| private String[] headers | |
| rows | back to summary |
|---|---|
| private List<String[]> rows | |
| AbstractListProcessor | back to summary |
|---|---|
| public AbstractListProcessor() Creates a new processor of | |
| AbstractListProcessor | back to summary |
|---|---|
| public AbstractListProcessor(int expectedRowCount) Creates a new processor of | |
| getHeaders | back to summary |
|---|---|
| public String[] getHeaders() Returns the record headers. This can be either the headers defined in
| |
| getRows | back to summary |
|---|---|
| public List The list of parsed records | |
| processEnded | back to summary |
|---|---|
| public void processEnded(T context) Implements com. Doc from com. This method will by invoked by the parser once, after the parsing process stopped and all resources were closed. It will always be called by the parser: in case of errors, if the end of the input us reached, or if the user stopped the process manually using
| |
| processStarted | back to summary |
|---|---|
| public void processStarted(T context) Implements com. Doc from com. This method will by invoked by the parser once, when it is ready to start processing the input.
| |
| rowProcessed | back to summary |
|---|---|
| public void rowProcessed(String[] row, T context) Implements com. Stores the row extracted by the parser into a list.
| |