org.argouml.uml.reveng
Interface ImportInterface

All Superinterfaces:
ModuleInterface

public interface ImportInterface
extends ModuleInterface

An interface which identifies an ArgoUML plug-in which imports source language modules and creates UML model elements in our model.

This interface is GUI independent and must not have any dependency on Swing/AWT or SWT.

Since:
0.23.2

Nested Class Summary
static class ImportInterface.ImportException
          Import subsystem exception to wrap any nested exceptions with when thrown.
 
Field Summary
static java.lang.String SOURCE_MODIFIERS_TAG
          The name of the TagDefinition which types the TaggedValues used store information about a ModelElement which can't be stored in the model.
static java.lang.String SOURCE_PATH_TAG
          The name of the TagDefinition which types the TaggedValues used store the source path of a ModelElement.
 
Fields inherited from interface org.argouml.moduleloader.ModuleInterface
AUTHOR, DESCRIPTION, DOWNLOADSITE, VERSION
 
Method Summary
 java.util.List<SettingsTypes.Setting> getImportSettings()
          Returns a list with objects that represent settings for this import.
 org.argouml.util.SuffixFilter[] getSuffixFilters()
          Provides an array of suffix filters for the module.
 boolean isParseable(java.io.File file)
          Tells if the object is parseable or not.
 java.util.Collection parseFiles(org.argouml.kernel.Project p, java.util.Collection<java.io.File> files, ImportSettings settings, org.argouml.taskmgmt.ProgressMonitor monitor)
          Parse a collection of source files.
 
Methods inherited from interface org.argouml.moduleloader.ModuleInterface
disable, enable, getInfo, getName
 

Field Detail

SOURCE_PATH_TAG

static final java.lang.String SOURCE_PATH_TAG
The name of the TagDefinition which types the TaggedValues used store the source path of a ModelElement. Used for round trip engineering purposes. Set during reverse engineering and used during code generation.

See Also:
Constant Field Values

SOURCE_MODIFIERS_TAG

static final java.lang.String SOURCE_MODIFIERS_TAG
The name of the TagDefinition which types the TaggedValues used store information about a ModelElement which can't be stored in the model. Used for round trip engineering purposes. Set during reverse engineering and used during code generation.

See Also:
Constant Field Values
Method Detail

getSuffixFilters

org.argouml.util.SuffixFilter[] getSuffixFilters()
Provides an array of suffix filters for the module.

Returns:
SuffixFilter[] suffixes for processing

isParseable

boolean isParseable(java.io.File file)
Tells if the object is parseable or not. It's is up to the module to decide whether it does something simple like verify that the file has the correct extension, or something more complicated.

Parameters:
file - object to be tested.
Returns:
true if parseable, false if not.

parseFiles

java.util.Collection parseFiles(org.argouml.kernel.Project p,
                                java.util.Collection<java.io.File> files,
                                ImportSettings settings,
                                org.argouml.taskmgmt.ProgressMonitor monitor)
                                throws ImportInterface.ImportException
Parse a collection of source files. The collection includes the full set of files selected by the user.

If the import module needs multiple parsing passes to resolve identifiers or for other reasons it needs to implement that internally. In previous versions of ArgoUML the multipass behavior was implemented both in the calling code and in some import modules. It is now solely the responsibility of the module.

Parameters:
p - the current project
files - Collection of files to be parsed
settings - Use this object to get common settings.
monitor - ProgressMonitor which will be updated as files are parsed and checked for user requests to cancel. It is mandatory for the module to both update progress and check for cancel requests.
Returns:
a collection of model elements parsed from the given files
Throws:
ImportInterface.ImportException - if an error occurs, this will contain the nested exception that was originally thrown

getImportSettings

java.util.List<SettingsTypes.Setting> getImportSettings()
Returns a list with objects that represent settings for this import. These objects implement the SettingsTypes.* interfaces.

The caller must determine what interface an object is implementing iterating the interfaces SettingsTypes.*

This is done this way to eliminate the need to use GUI elements. The settings can easily be mapped into any GUI elements, this way we are independent from the type of GUI.

Returns:
the list of settings that are required by this particular import


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook