Monday, 24 May 2010

PWS HW1 - DOM Parser Structure

The structure that I used for DOM is:

  • 5 files. One generic and four "real" XML parsers
  • The generic DOM file receive all the parameters from the main java file, it initialize the parsers, receive the data parsed, generate the User Profile file using the data parsed and print it out.
  • For the communication between the "real" parsers and the generic DOM file I created "beans" for each one of the XML files (java files with variables, constructors, get methods and set methods).
  • All the "real" DOM parsers has the same structure. The unique thing that is different is the structure of the XML file to parse.
  • For example, the ShortCV Parser has this structure
  • Basically it has two methods: one for initialization and other for parser
  • When you initialize this parser, it initialize all the variables and initialize the factory and the builder
  • When you use the parser method it fill and returns the ShortCV data.

No comments:

Post a Comment