JAVA——文档注释(javavdoc)通用注释-超链接@see与@link的使用
生活随笔
收集整理的這篇文章主要介紹了
JAVA——文档注释(javavdoc)通用注释-超链接@see与@link的使用
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
基本概念
@see:必須頂頭寫
@link:任意位置寫
語法
1. @see
@see 標簽允許用戶引用其他類的文檔。具體使用方式如下: @see classname @see fully-qualified-classname @see fully-qualified-classname#方法名稱 @see fully-qualified-classname#屬性名稱?
/*** 對上述接口做aop攔截,記錄到操作日志里面** @see com.demo.its.controller.UserController#login(String, String)* @see com.demo.its.controller.TreeController#getTree(String)*/public void doManageLogAfter(JoinPoint joinPoint) {// do some codes}語法格式: @see 全路徑包名#方法名(參數(shù)類型列表)
? ?一般用在方法上面,可以直接點擊進入對應的方法上,如果調用方法被篡改了,注釋會報紅,起到一個提示作用。
? ?此注解要在注釋里面頂頭寫,否則無效。
調用正常
調用有錯
不頂頭無效
2. @link
/*** 對上述接口做aop攔截,記錄到操作日志里面* <p>* {@link com.demo.its.controller.UserController#login(String, String)}* {@link com.demo.its.controller.TreeController#getTree(String)}*/public void doManageLogAfter(JoinPoint joinPoint) {// do some codes}語法格式:{@link 全路徑包名#方法名(參數(shù)類型列表)}
? ?同上,用在方法上,唯一區(qū)別是可以不用頂頭寫,推薦此種寫法👍
調用正常
調用有錯
不頂頭也可以
參考文章
https://www.jianshu.com/p/24f492810321
https://blog.csdn.net/qq_27093465/article/details/59121608
https://blog.csdn.net/pianistOfSoftware/article/details/51896986
總結
以上是生活随笔為你收集整理的JAVA——文档注释(javavdoc)通用注释-超链接@see与@link的使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++——赫夫曼编码-译码器(Huffm
- 下一篇: JavaFX——JavaFX概览