How to generate links to the android Classes' reference in javadoc?

本文介绍如何使用Javadoc的-linkoffline参数正确链接到Android类引用文档。通过指定本地的package-list文件路径,同时保持链接指向在线文档的方式,解决无法生成有效链接的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文:http://stackoverflow.com/questions/2818204/how-to-generate-links-to-the-android-classes-reference-in-javadoc

Javadoc relies on a file calledpackage-listto determine what Java packages are documented below a given directory. For some reason, such a file ismissingforhttp://d.android.com/reference/, therefore the "naive" approach with

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

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-linkparameters for you, so that doesn't really make any difference)

However, Javadoc offers the-linkofflineparameter to be able to adjust for preciselythissituation: 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-linktakes only one parameter (the URL of the JavaDoc docs you want to link to),-linkofflinetakes a second one. That one is the location of thepackage-listfile!

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

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

in theExtra Javadoc optionsin the 3rd dialog. That way you use thepackage-listof your locally installed Android docs, but the links in your generated Javadoc will still point to the online version anyway.

Hope it helps!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值