Processor implementation for storing all MasterDetailRecord generated form the parsed input into a list.
A typical use case of this class will be:
ObjectRowListProcessor detailProcessor = new ObjectRowListProcessor(); MasterDetailListProcessor masterRowProcessor = new MasterDetailListProcessor(detailProcessor) { protected boolean isMasterRecord(String[] row, ParsingContext context) { return "Total".equals(row[0]); } }; parserSettings.setRowProcessor(masterRowProcessor); List<MasterDetailRecord> rows = masterRowProcessor.getRecords();
AbstractMasterDetailProcessor, Processor, AbstractParser
| Modifier and Type | Field and Description |
|---|---|
| private String[] | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | AbstractMasterDetailListProcessor(RowPlacement
indication whether the master records are placed in relation its detail records in the input.
rowPlacement, AbstractObjectListProcessor<T extends Context> Master record (Totals) Master record (Totals) above detail records under detail records Totals | 100 Item | 60 Item | 60 Item | 40 Item | 40 Totals | 100 the detailProcessor)ObjectRowListProcessor that processes detail rows.Creates a MasterDetailListProcessor |
| public | AbstractMasterDetailListProcessor(AbstractObjectListProcessor<T extends Context>
the detailProcessor)ObjectRowListProcessor that processes detail rows.Creates a MasterDetailListProcessor assuming master records are positioned above its detail records in the input. |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | |
| public List | Returns: the list of generated MasterDetailRecords at the end of the parsing process.Returns the list of generated MasterDetailRecords at the end of the parsing process. |
| protected void | masterDetailRecordProcessed(MasterDetailRecord
MasterDetailRecord generated with a set of associated records extracted by the parserA contextual object with information and controls over the current state of the parsing process context)Implements abstract com. MasterDetailRecord with the set of associated parsed records into a list.
|
| public void | processEnded(T
A contextual object with information and controls over the state of the parsing process context)Overrides com. Implements com. |
| headers | back to summary |
|---|---|
| private String[] headers | |
| records | back to summary |
|---|---|
| private final List<MasterDetailRecord> records | |
| AbstractMasterDetailListProcessor | back to summary |
|---|---|
| public AbstractMasterDetailListProcessor(RowPlacement rowPlacement, AbstractObjectListProcessor<T extends Context> detailProcessor) Creates a MasterDetailListProcessor
| |
| AbstractMasterDetailListProcessor | back to summary |
|---|---|
| public AbstractMasterDetailListProcessor(AbstractObjectListProcessor<T extends Context> detailProcessor) Creates a MasterDetailListProcessor assuming master records are positioned above its detail records in the input.
| |
| getHeaders | back to summary |
|---|---|
| public String[] getHeaders() Returns the record headers. This can be either the headers defined in
| |
| getRecords | back to summary |
|---|---|
| public List Returns the list of generated MasterDetailRecords at the end of the parsing process.
| |
| masterDetailRecordProcessed | back to summary |
|---|---|
| protected void masterDetailRecordProcessed(MasterDetailRecord record, T context) Implements abstract com. Stores the generated
| |
| processEnded | back to summary |
|---|---|
| public void processEnded(T context) Overrides com. 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
| |