public abstract class ItemRef 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.
Note that both FolderRef
and ModuleRef
instances can be converted to an ItemRef
instance of using the
toItem()
method.
Below is a snippet illustrating how to use an item reference (see CommandRunner
for a full snippet):
ItemRef item = ItemRef.qualifiedName("/MyFolder/MyModule"); DeleteItemCommand command = new DeleteItemCommand(item); myCommandRunner.run(command);
CommandRunner
,
DeleteItemCommand
,
PurgeItemCommand
,
FolderRef.toItem()
,
ModuleRef.toItem()
Constructor and Description |
---|
ItemRef() |
Modifier and Type | Method and Description |
---|---|
static ItemRef |
defaultLinkModule(ItemRef sourceModule,
ItemRef targetModule)
Returns a reference to the item which is the default link module of the specified source and target module pair.
|
static ItemRef |
name(FolderRef folder,
String name)
Returns a reference to an item based on its parent folder and its name.
|
static ItemRef |
qualifiedName(String qualifiedName)
Returns a reference to an item based on its qualified name.
|
abstract FolderRef |
toFolder()
Converts this item reference to a folder reference.
|
abstract ModuleRef |
toModule()
Converts this item reference to a module reference.
|
static ItemRef |
uniqueID(String uniqueID)
Returns a reference to an item based on its DOORS unique ID.
|
static ItemRef |
url(String url)
Returns a reference to an item based on its DOORS URL.
|
public static ItemRef qualifiedName(String qualifiedName)
Note that in case the item is actually a DOORS project, its qualified name is the name of the project prefixed by a '/'
character
(e.g. "/MyProject"
).
qualifiedName
- the qualified name of the item.public static ItemRef name(FolderRef folder, String name)
folder
- a reference to the containing folder.name
- the name of the item.public static ItemRef url(String url)
url
- the DOORS URL of the item.public static ItemRef uniqueID(String uniqueID)
uniqueID
- the DOORS unique ID of the item.public static ItemRef defaultLinkModule(ItemRef sourceModule, ItemRef targetModule)
sourceModule
- the source moduletargetModule
- the target modulepublic abstract ModuleRef toModule()
public abstract FolderRef toFolder()