The SAX "call back" handler for the trade engine message processor classes.
The methods in this class are called when the SAX parser recognizes the components of an XML document. The MessageProcessor class handles the document start (the message envelope) and recognizes the start of each message type. The MessageProcessor class allocates the appropriate message processor (derived from MessageBaseMessage base class) for each message. Calls the element, endElement and characters methods in the message processor to process the start tag, characters region and end tag. Note that the state machine below skips the first tag that starts a message (e.g., aim_order).
The MessageProcessor is passed a reference to an ArrayList. After each message is processed it is added to the ArrayList.
Trade engine messages are packaged within a tradeEngine XML envelope. This allows multiple sub-messages to be included in one tradeEngine message.
Public Member Functions | |
MessageProcessor (ArrayList msgList) | |
void | warning (SAXParseException e) |
void | error (SAXParseException e) throws SAXParseException |
void | fatalError (SAXParseException e) throws SAXParseException |
void | startDocument () |
void | endDocument () |
void | characters (char[] charSeq, int start, int len) |
The characters method is called to process character sequences that occur between tags. | |
void | startElement (String uri, String localName, String qualName, Attributes attributes) |
void | endElement (String uri, String localName, String qualName) |
Private Attributes | |
States | mCurrentState = States.BAD_STATE |
MessageInterface | mMessage = null |
ArrayList | mMsgList = null |
|
|
|
The characters method is called to process character sequences that occur between tags. For example: <TAG>This is a String</TAG> This also includes white space that may be used in formatting the XML. The SAX parser passes a reference to the input character array for the entire XML document. The start parameter is the offset in this array to the character region and the len parameter is its length. Here I'm not interested in white space, so if the character region is nothing but white space, the method just returns.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|