Returns a tag of the specified kind in the specified Doc element.

This function actually does the same as the following script:


allTags = tags(docElement, tagName);
(allTags.length() > 0) ? allTags[0] : null;
So, when you are sure you need only one Tag element you may rather use this function than the script above.

Note, the function returns the element identifier. To convert it to the element object, you will need to use the findElementById() function:


findElementById(tag("@mytag"))
Parameters:

element

The Doc element whose tag is requested.

It may be also a Type element, which is automatically converted to the ClassDoc by calling the Doclet API method: Type.asClassDoc()

If the element is not an instance of Doc or Type type, the function returns null.

If this parameter is not specified, the generator context element is assumed, i.e. the same as the call: contextElement.tag(tagName)

tagName
The name of the tag kind to search for.

See Also:

hasTag(), tags(), findElementById(), GOMElement.id