2017-05-04 28 views
9

如果有一種方法將javadoc中的鏈接放置到駐留在src/main /目錄中的標準資源文件中,資源或src/test/resources,以便另一個編碼器可以快速導航到資源文件(在本例中爲JSON文件)。Javadoc鏈接到src/main/resource或使用相對路徑的src/test/resource文件

這些文件用於單元測試,需要隨着模式的變化而經常修改。

這裏的答案Link to text file (resource) in Javadoc沒有幫助,因爲絕對路徑太脆弱了。

有沒有辦法像@see一樣做資源? 如果javadoc本身不夠用,IntelliJ特有的東西會很棒。

回答

0

無需提及絕對路徑。見下面我的包和類結構。如果我遵循URI規則,我會從一個姐姐包中取出一個..去一個文件夾,然後像這樣提到它。有用!點擊該文件打開文件。雖然我在eclipse中已經說明了這一點,但我認爲這應該是IDE不可知的。

/** 
* Removes all the stop words like a, for, the etc. from the text. For a 
* full list of stop words check 
* <a href="file:../resources/stopWords.txt">/resources/stopWords.txt</a> 
* 
* @return String free of all the stop-words 
* @param text 
*   The string to be cleaned, do null check at your end 
*/ 

enter image description here

Package Structure