本文介绍了如何生成链接到Android类“在Javadoc参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当我生成javadoc了解我在Eclipse中的Andr​​oid项目,有很多的警告像

When I generate javadoc for my Android project in Eclipse, there are lots of warnings like

cannot find symbol
symbol  : class TextView

warning - Tag @see: reference not found: android.app.Dialog

我也试过

-link http://developer.android.com/reference/
-link http://java.sun.com/j2se/1.4.2/docs/api/

额外的Javadoc选项标签在配置的Javadoc参数(以空格必须用引号括起来路径名) (3 Eclipse的>项目 - 对话框>生成Javadoc)。

in Extra javadoc options (path names with white spaces must be enclosed in quotes) tab in Configure Javadoc Arguments (3rd dialog of eclipse->project->Generate Javadoc).

但只有 -link http://java.sun.com/ J2SE / 1.4.2 /文档/ API / 的工作,即对String类链接 http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true 生成。但对于 android.app.Dialog ,没有链接生成。

But only -link http://java.sun.com/j2se/1.4.2/docs/api/ is working i.e for String classlink http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true is generated. but for android.app.Dialog , no link is generated.

修改

我也试过在选择的android.jar 选择引用的档案和项目应生成的链接设置页配置标准doclet 的Javadoc参数(的Eclipse的>项目 - >第二个对话框生成Javadoc)但是这创造了本地链接的文档在本地Android的SDK目录,而不是网上的Andr​​oid引用像它的Java API的。

I also tried selecting android.jar in Select referenced archives and projects to which links should be generatedtab in Configure Javadoc arguments for standard doclet (2nd dialog of eclipse->project->Generate Javadoc),but this creates local links to docs in local android-sdk directory, NOT the online Android references like it does for Java APIs.

推荐答案

的Javadoc依赖于一个名为包列表来确定哪些Java包都记录下面给定的目录。出于某种原因,这样的文件是丢失作为 http://d.android.com/reference/,所以天真与方法

Javadoc relies on a file called package-list to determine what Java packages are documented below a given directory. For some reason, such a file is missing for http://d.android.com/reference/, therefore the "naive" approach with

-link http://d.android.com/reference/

不起作用&ndash的;你会得到一个警告,包列表无法检索并没有链接生成到您的文档。 (注:在第二次月食对话框中的复选框只是组装 -link 参数给你,所以这并不真正使任何区别)

doesn't work – you get a warning that the package-list could not be retrieved and no links are generated into your docs. (Note: The checkboxes in that 2nd eclipse dialog just assemble -link parameters for you, so that doesn't really make any difference)

然而,Javadoc中提供了 -linkoffline 参数可以调整为precisely 的情况:你要链接到一些在线等Javadoc文档,但你不能在生成自己的文档的时候访问它。下面是它如何工作的:当 -link 只需要一个参数(要链接到的JavaDoc文档的URL), -linkoffline 需要第二个。这一个是位置的包列表文件!

However, Javadoc offers the -linkoffline parameter to be able to adjust for precisely this situation: You want to link to some other Javadoc documentation online, but you cannot access it at the time of generating your own docs. Here's how it works: While -link takes only one parameter (the URL of the JavaDoc docs you want to link to), -linkoffline takes a second one. That one is the location of the package-list file!

所以,链接到网上Android的参考文档,你应该的不可以选择在第二日食对话框中任何复选框,而是添加

So, to link to the online Android reference documentation, you should not select any checkboxes in the 2nd eclipse dialog, but instead add

-linkoffline http://d.android.com/reference file:/C:/pathtoyour/android-sdk-windows/docs/reference

额外的Javadoc在第3个对话框选项的。这样,你使用包列表的本地安装的Andr​​oid文档,但在你生成的Javadoc的链接将仍然指向在线版本反正。

in the Extra Javadoc options in the 3rd dialog. That way you use the package-list of your locally installed Android docs, but the links in your generated Javadoc will still point to the online version anyway.

希望它能帮助!

这篇关于如何生成链接到Android类“在Javadoc参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:04