Finds a program element (i.e. a class or a class member) according to the name specified in the form:
That name form is precisely the one used in Javadoc @see or {@link} tags. For more details, see Javadoc documentation, for instance at: http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.htmlpackage.class#member
When the 'package'
or 'package.class'
part
of the name is not specified, this is called "partially-qualified" name.
Such a name makes sense only in the context of a certain class or a package,
which must be provided in the 'context'
parameter of this function.
Parameters:
context
Specifies the context class or package against which the partially-qualified name is to be resolved.Basically, this should be a
ClassDoc
orPackageDoc
element. However, elements of some other types that immediately lead to an associated class are also acceptable.Here are all possible element types and how the context class/package is obtained in each case using the methods of Doclet API:
Element Type Context class/package ClassDoc
ClassDoc
PackageDoc
PackageDoc
MemberDoc
MemberDoc.containingClass()
Type
Type.asClassDoc()
Tag
Tag.holder()
and then again according to this tableWhen the context class or package is not provided, the partially-qualified name cannot be resolved. In that case, the function will return
null
.If this parameter is omitted (not specified), the generator context element is assumed, i.e. the same as the call:
contextElement.findProgramElement(nameSpec)
nameSpec
Specifies the fully- or partially-qualified name of the program element to search for.
Returns:
The generator representation of the found program element (the element type will be resolved up to:ClassDoc
,ConstructorDoc
,MethodDoc
orFieldDoc
); ornull
, if no program element can be found by the specified name.
See Also:
findPackage()
,findAnnotation()