Javadoc 链接到另一个包中的类 [英] Javadoc linking to a class in another package

查看:48
本文介绍了Javadoc 链接到另一个包中的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个包,ShapesFruits:

com.myproject.Shapes.
    Circle
    Square
    Triangle
com.myproject.Fruits.
    Apple
    Orange

我正在为 Apple 编写 JavaDoc,需要向 Square 提供一个 {@link}.

I am writing the JavaDoc for Apple and need to provide an {@link} to Square.

我已经尝试了以下所有方法,但都没有奏效:

I have tried all of the following, and none of them work:

{@link Square}
{@link com.myproject.Square}

我已经能够找到链接到以下内容的文档:(a) 同一包中的类,或 (b) 外部 URL,但不能找到另一个包中的类.

I've been able to find documentation for linking to: (a) classes within the same package, or (b) externals URLs, but not classes in another package.

知道正确的语法应该是什么吗?谢谢!

Any ideas what the correct syntax should be? Thanks!

推荐答案

正确的语法 变体是

{@link [<package>.]<class>[#<method>]}
{@link #<method>}

您缺少一个完整的包裹.下面的例子应该是正确的

You were missing a complete package. The following example should be correct

{@link com.myproject.Shapes.Square} 
                     ^^^^^^

这篇关于Javadoc 链接到另一个包中的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆