The AlfImporter class provides the basic interface for importing Alf code from external files. An AlfImporter is instantiated with two pieces of information:
Importing of Alf code then takes place in two steps:
The API allows you to carry out these steps individually (which is useful if, for example, you wish to import multiple model unit files before mapping) or using a single call (for a single model unit file).
Importation takes place into the currently open and active Project. Once you instantiate an AlfImporter object in a Project, it is no longer consistent to use an AlfCompiler object in that Project. Instead, you should save and close the Project once you have completed any importation, and then reopen it if you wish to do further Alf compilations on it. Alternatively, you can use the AlfActionUtil.importFrom method to do the importation (as described in Importer API: Utilities), in which case the Project will be restored for normal Alf operations at the completion of the method. |