public abstract class RowProcessor extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
RowProcessor(OrderProcessor inProcessor,
BrokerID inBrokerID)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected BrokerID |
geBrokerID()
The brokerID value to use for each order.
|
List<FailedOrderInfo> |
getFailedOrders()
The list of orders that failed to process.
|
int |
getNumFailed()
Number of orders that failed to process.
|
int |
getNumSuccess()
Number of orders that were successfully processed.
|
int |
getTotal()
Returns the total number of orders processed.
|
void |
initialize(String... inHeaders)
Initialize the instance with the headers for each column.
|
protected abstract Order |
parseOrder(String[] inRow)
Parses the supplied row and creates an order instance from it.
|
void |
processOrder(int inIndex,
String... inRow)
Parses the order in the supplied row and processes it using the
OrderProcessor. |
protected abstract void |
setHeaders(String[] inHeaders)
Implemented by subclasses to initialize themselves with the
supplied headers.
|
protected RowProcessor(OrderProcessor inProcessor, BrokerID inBrokerID)
inProcessor - the processor. Cannot be null.inBrokerID - the broker ID.public final void initialize(String... inHeaders) throws OrderParsingException
inHeaders - the headers for each column. Cannot be null.OrderParsingException - if the supplied row is not
a valid header row.public final void processOrder(int inIndex,
String... inRow)
OrderProcessor.inIndex - the row index.inRow - the row value, cannot be null.public final int getTotal()
getNumFailed() & getNumSuccess().public final int getNumFailed()
public final int getNumSuccess()
public final List<FailedOrderInfo> getFailedOrders()
protected final BrokerID geBrokerID()
protected abstract void setHeaders(String[] inHeaders) throws OrderParsingException
inHeaders - the headers specified in the csv file.OrderParsingException - if there were errors with the supplied
headers.protected abstract Order parseOrder(String[] inRow) throws OrderParsingException
inRow - the supplied row.OrderParsingException - if there were errors parsing theCopyright © 2014. All Rights Reserved.