java link 到指定方法_链接到其他类的方法Javadoc(Javadoc link to method in other class)

Currently I'm referencing methods in other classes with this Javadoc syntax:

@see {@link com.my.package.Class#method()}

And in what I understand from the documentation this is the correct way to do this. But now to the funny part, or frustrating. When I generate this javadoc I first of all get following error:

warning - Tag @see:illegal character: "123" in "{@link com.my.package.Class#method()}"

warning - Tag @see:illegal character: "64" in "{@link com.my.package.Class#method()}"

warning - Tag @see: reference not found: {@link com.my.package.Class#method()}

The Generated HTML code of this is:

"," com.my.package.Class#method()} ","

And of course I have no link. Can anyone tell me what's happening, and any hints on how to fix this?

According to the ASCII table characters 123 and 64 for wold represent { and @, so why aren't these characters valid when this syntax is correct according to the documentation?

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!感谢您的提问。根据您的问题,我理解您想要将一个Java项目的Javadoc转移到另一个Java项目的Javadoc中。如果我的理解有误,请让我知道。 要将一个Java项目的Javadoc转移到另一个Java项目的Javadoc中,您可以按照以下步骤操作: 1. 在源代码中为您想要转移的方法添加Javadoc注释。您可以使用以下示例注释格式: /** * 这是一个示例方法。 * @param param1 参数1 * @param param2 参数2 * @return 返回值 */ 2. 使用JavaDoc工具生成Javadoc文档。您可以使用以下命令生成Javadoc文档: javadoc -d [输出目录] [需要生成文档的Java文件] 例如: javadoc -d /home/user/myproject/doc -sourcepath /home/user/myproject/src com.example.myproject 这将生成一个名为index.html的Javadoc文档文件,可以在浏览器中查看。 3. 将生成的Javadoc文档复制到您想要转移的Java项目中。您可以将生成的Javadoc文档文件夹复制到您想要转移的Java项目的根目录下。 4. 在目标Java项目中使用Javadoc注释中的@see标签引用源Java项目的Javadoc文档。例如: /** * 这是一个示例方法。 * @param param1 参数1 * @param param2 参数2 * @return 返回值 * @see com.example.myproject.ExampleClass#exampleMethod */ 这将在Javadoc文档中为该方法添加一个“参见”链接,该链接指向源Java项目中的ExampleClass和exampleMethod()方法。 希望这些步骤能帮助您将一个Java项目的Javadoc转移到另一个Java项目的Javadoc中。如果您有任何其他问题,请随时问我。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值