Top Description Constructors Methods
com.univocity.parsers.common.processor

public abstract Class MasterDetailProcessor

extends AbstractMasterDetailProcessor<ParsingContext>
Class Inheritance
Imports
com.univocity.parsers.common.*, com.univocity.parsers.common.processor.core.*, com.univocity.parsers.conversions.*

A RowProcessor implementation for associating rows extracted from any implementation of AbstractParser into MasterDetailRecord instances.

For each row processed, a call to MasterDetailProcessor#isMasterRecord(String[], Context) will be made to identify whether or not it is a master row.

The detail rows are automatically associated with the master record in an instance of MasterDetailRecord.

When the master record is fully processed (i.e. MasterDetailRecord contains a master row and all associated detail rows), it is sent to the user for processing in MasterDetailProcessor#masterDetailRecordProcessed(MasterDetailRecord, Context).

Note

this class extends ObjectRowProcessor and value conversions provided by Conversion instances are fully supported.

Author
Univocity Software Pty Ltd - [email protected]
See Also
MasterDetailRecord, RowPlacement, AbstractParser, ObjectRowListProcessor, RowProcessor

Constructor Summary

AccessConstructor and Description
public
MasterDetailProcessor(RowPlacement
indication whether the master records are placed in relation its detail records in the input.

Master record (Totals)       Master record (Totals)
 above detail records         under detail records

   Totals | 100                 Item   | 60
   Item   | 60                  Item   | 40
   Item   | 40                  Totals | 100

rowPlacement
,
ObjectRowListProcessor
the ObjectRowListProcessor that processes detail rows.
detailProcessor
)

Creates a MasterDetailProcessor

public

Method Summary

Inherited from com.univocity.parsers.common.processor.core.AbstractMasterDetailProcessor:
isMasterRecordmasterDetailRecordProcessedprocessEndedprocessStartedrowProcessedrowProcessed

Constructor Detail

MasterDetailProcessorback to summary
public MasterDetailProcessor(RowPlacement rowPlacement, ObjectRowListProcessor detailProcessor)

Creates a MasterDetailProcessor

Parameters
rowPlacement:RowPlacement

indication whether the master records are placed in relation its detail records in the input.



Master record (Totals)       Master record (Totals)
 above detail records         under detail records

   Totals | 100                 Item   | 60
   Item   | 60                  Item   | 40
   Item   | 40                  Totals | 100

detailProcessor:ObjectRowListProcessor

the ObjectRowListProcessor that processes detail rows.

MasterDetailProcessorback to summary
public MasterDetailProcessor(ObjectRowListProcessor detailProcessor)