This function works with the elements that represent instances of com.sun.javadoc.Doc class. It returns tags of the specified kind in the specified Doc element.

Actually, the function passes the call to Doc.tags(String tagname) method and returns an array containing identifiers of the Tag elements representing the com.sun.javadoc.Tag objects returned by this method.

Further, you may use findElementsByIds() function to convert those identifiers into elements (in order to iterate by them, for instance):


findElementsByIds(tags("@mytag"))
Parameters:

element

The Doc element whose tags are 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, an empty array will be returned.

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

tagName
The name of the tag kind to search for.
tagNames
Instead of a single tag kind name, you may specify several names in the form of an array (e.g. created with Array() function). For example:
tags(Array("@mytag1", "@mytag2"))
In that case, the returned array will contain all tags found by each specified tag name.

The tags in the result array will follow respectively to the specified name order. If a tag name is repeating so will do the corresponding tags.

See Also:

tag(), hasTag(), GOMElement.id, findElementsByIds(), findElementById(), elementAt()