1、准備需要生成JavaDoc文檔的類
/** * 測試生成JavaDoc文檔 * * @author xiaomaomao * @version V1.0 * @since V1.0 */ public class TestGenerateDoc { private Integer id; private String message;
/** * 發送消息的方法 * @param id 接收信息人唯一標識 * @param fileName 文件名稱 * @return sendOK 返回是否發送成功 * @throws FileNotFoundException 可能出出現文件不存在異常 */ public Boolean sendMessage(Integer id, String fileName) throws FileNotFoundException { Boolean sendOk = false; FileInputStream inputStream = new FileInputStream(fileName); String message = inputStream.toString(); if (message != null) { System.out.println("I will send message to" + id + "and the message content is" + message); sendOk = true; } return sendOk; } }
2、tools---->GenerateJavaDoc---->可以看到如下界面:
Generate JavaDoc scope:選擇你需要生成JavaDoc文檔的內容,我這里只需要將TestGenerateDoc.java這個類生成文檔.
Output directory:生成的JavaDoc文檔會存放在哪里.
Locale:zh_CN
Other command line arguments:
-encoding UTF-8 -charset UTF-8 -author -version -windowtitle "TestGenerateDocV1.0"
注意參數里面的TestGenerateDocV1.0就是你生成的JavaDoc存放的指定目錄
3、點擊OK便可以生成JavaDoc文檔
4、生成的JavaDoc文檔如下: