[英]JavaDoc @link package in Android Studio
I need to link to a package in JavaDoc. 我需要链接到JavaDoc中的包。
Example: 例:
@param example description (see {@link com.example.packagename this})
With the code above, I get this message: 使用上面的代码,我收到此消息:
warning - Tag @link: reference not found: com.example.packagename
Linking to a class in the same package works fine, but I need to link directly to the package. 链接到同一个包中的类工作正常,但我需要直接链接到包。
It's not possible with @link
. 使用@link
是不可能的。
Create package.html
file or a single package-info.java
in your com.example.packagename
在com.example.packagename
创建package.html
文件或单个package-info.java
/**
* This is packagename
*/
package com.example.packagename;
Then you can link to this package by using @see
. 然后,您可以使用@see
链接到此包。
/**
* @param example description
* @see com.example.packagename
*/
void doWork(String example) {
}
Now you android studio will show the documentation as follow: 现在你android studio将显示如下文档:
By clicking on com.example.packagename
, the javadoc inside package-info.java
will be shown. 通过单击com.example.packagename
,将显示package-info.java
的javadoc。
Note: Instead of linking packagename directly, You can use <a>
tag: 注意:您可以使用<a>
标签代替直接链接packagename:
* @see <a href="{@docRoot}/com/example/packagename/package-summary.html">Packagename</a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.