The AlfImporter class provides the basic interface for importing Alf code from external files. An AlfImporter is instantiated with two pieces of information:
- A string giving the path to the model directory, which is the root directory for all files being imported.
- An optional ProgressStatus object, the description of which is updated with the names of files being imported. (This argument may be null, if you do not wish to display progress status.)
Importing of Alf code then takes place in two steps:
- Parsing one or more Alf model units (along with their subunits) from files in the model directory, caching their resulting abstract syntax representations.
- Mapping (after constraint checking) all parsed units into the UML model in MagicDraw.
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).