public class OrderParser extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMENT_MARKER |
| Constructor and Description |
|---|
OrderParser(RowProcessor inProcessor)
Creates a parser instance that parses the orders and processes
them using the supplied delegate.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumBlankLines()
Returns the total number of blank lines.
|
int |
getNumComments()
Returns the total number of lines with comments.
|
int |
getNumLines()
Returns the total number of lines processed.
|
void |
parseOrders(InputStream inStream)
Parses rows out of the supplied file and uses the processors to
process them.
|
public static final String COMMENT_MARKER
public OrderParser(RowProcessor inProcessor)
inProcessor - the delegate to use for creating orders from
each row and processing them. Cannot be nullpublic int getNumLines()
public int getNumBlankLines()
public int getNumComments()
public void parseOrders(InputStream inStream) throws IOException, OrderParsingException
inStream - the input stream with csv input containing orders.
The stream is closed when this method returns.IOException - if there was an error opening the supplied file or
if the file had no orders to send.OrderParsingException - if the file didn't have the
column headers specified correctly or if the file didn't have any orders.Copyright © 2014. All Rights Reserved.