Target Converter Processing

Figure 6.3 shows a simplified high-level collaboration diagram of the classes and processing of the target converter. Again, the exact details vary for each of the converters.

Figure 6.3. Target Converter Collaboration Diagram


The main routine is very similar to that of the source converter in that it processes the command line arguments. However, instead of just passing along the name of one legacy source file to the TargetConverter class, it reads a directory to retrieve the file names of the XML documents to process. It also opens and closes the output legacy format file. For each XML document file in the input directory it calls the TargetConverter's processDocument method. This method parses the input XML document file and loads it into a DOM Document object tree. Then, for each Element that represents a record in the legacy format, it calls the RecordWriter's parseRecord method. This method creates a DataCell object for each Element in the DOM tree that corresponds to a field in the legacy format record. As with the source converter, the derived class of the DataCell object is determined by the legacy data type of the target field. Finally, the RecordWriter's writeRecord method is called to write the legacy format record. In its processing it calls the fromXML method of each DataCell object to convert the data representation from the schema language data type to the legacy format data type.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset