Main Page | Packages | Class Hierarchy | Class List | File List | Class Members

pullparse.ParseXML Class Reference

List of all members.

Detailed Description

ParseXML Aug 24, 2004.

Author:
Ian Kaplan, www.bearcave.com, iank@bearcave.com


Public Member Functions

 ParseXML (boolean validating) throws XmlPullParserException
 Initialize the mPullParser with an XmpPullParser object.
void parse (FileReader reader, ArrayList msgList) throws XmlPullParserException, IOException, ParseException
 Parse a trade engine message document.

Package Attributes

XmlPullParser mPullParser = null


Constructor & Destructor Documentation

pullparse.ParseXML.ParseXML boolean  validating  )  throws XmlPullParserException
 

Initialize the mPullParser with an XmpPullParser object.

Parameters:
validating true = XML Schema validation, false, no validation. At the time of this writing, XmlPullParser does not support validation.
00041 { 00042 XmlPullParserFactory factory; 00043 factory = XmlPullParserFactory.newInstance(); 00044 factory.setNamespaceAware( true ); 00045 factory.setValidating( validating ); 00046 mPullParser = factory.newPullParser(); 00047 } // constructor


Member Function Documentation

void pullparse.ParseXML.parse FileReader  reader,
ArrayList  msgList
throws XmlPullParserException, IOException, ParseException
 

Parse a trade engine message document.

This method reads the start document tag, end document tag and the tags that start each of the trade engine messages. When a message start tag is read, the associated message object is created. The parser is passed to the initialize method of the trade engine message, allowing the object to initialize itself from the XML.

00060 { 00061 assert mPullParser != null; 00062 00063 mPullParser.setInput( reader ); 00064 for (int eventType = mPullParser.getEventType(); 00065 eventType != XmlPullParser.END_DOCUMENT; 00066 eventType = mPullParser.next()) { 00067 if (eventType == XmlPullParser.START_TAG) { 00068 String localName = mPullParser.getName(); 00069 MessageBase message = null; 00070 if (localName.equals("aim_order")) { 00071 message = new AimOrder(); 00072 } 00073 else if (localName.equals("control")) { 00074 message = new Control(); 00075 } 00076 if (message != null) { 00077 message.initialize( mPullParser ); 00078 msgList.add( message ); 00079 } 00080 } 00081 } // for 00082 } // parse


Member Data Documentation

XmlPullParser pullparse.ParseXML.mPullParser = null [package]
 


The documentation for this class was generated from the following file:
Generated on Sat Aug 28 14:08:27 2004 for PullParse by doxygen 1.3.8