public abstract class ModuleRef extends Object
Creating a reference instance does not execute anything on the DOORS client, it is just a way to get a pointer to an element on which commands are executed. The reference is only resolved to the actual element by the time the command is executed and may result in an element not being found.
Instances of ModuleRef
created with the qualifiedName
or name
allows the use of the
CreateModuleCommand
command, as the reference contains the information necessary to create the module.
Below is a snippet illustrating how to use a module reference (see CommandRunner
for a full snippet):
ModuleRef module = ModuleRef.qualifiedName("/MyFolder/MyModule"); EditModuleCommand command = new EditModuleCommand(module, TerminationMode.SAVE_AND_CLOSE); command.add(..); // add EditModuleFragment instances myCommandRunner.run(command);
CommandRunner
,
EditModuleCommand
,
CreateModuleCommand
Constructor and Description |
---|
ModuleRef() |
Modifier and Type | Method and Description |
---|---|
static ModuleRef |
defaultLinkModule(ModuleRef sourceModule,
ModuleRef targetModule)
Returns a reference to the default link module for the specified source and target module pair.
|
static ModuleRef |
name(FolderRef folder,
String name)
Returns a reference to a module based on its parent folder and its name.
|
static ModuleRef |
qualifiedName(String qualifiedName)
Returns a reference to a module based on its qualified name.
|
abstract ItemRef |
toItem()
Converts this module reference to an item reference.
|
static ModuleRef |
uniqueID(String uniqueID)
Returns a reference to a module based on its DOORS unique ID.
|
static ModuleRef |
url(String url)
Returns a reference to a module based on its DOORS URL.
|
public static ModuleRef qualifiedName(String qualifiedName)
qualifiedName
- the qualified name of the module.public static ModuleRef name(FolderRef folder, String name)
folder
- a reference to the containing folder.name
- the name of the module.public static ModuleRef url(String url)
Note that an Object URL might also be used here to create a reference to a module. An Object URL embeds all necessary information to resolve its container module.
url
- the DOORS URL of the module (or Object whose container module is of interest).public static ModuleRef uniqueID(String uniqueID)
uniqueID
- the DOORS unique ID of the module.public static ModuleRef defaultLinkModule(ModuleRef sourceModule, ModuleRef targetModule)
sourceModule
- the source moduletargetModule
- the target moduleCreateLinkFragment
public abstract ItemRef toItem()
DeleteItemCommand
, can be executed on both modules and folders
and therefore require a item reference.DeleteItemCommand
,
PurgeItemCommand