當你使用eclipse作為開發工具,創建一個類時,可以讓eclipse自動為你的新建的類創建已經格式化好的注釋。
在eclipse的window菜單->preferences,
在Preferences左邊選擇java->"Code Style" ->"Code Templates".
此時在Preferences右邊可以選擇"Comments",來制定自己的文件注釋,類注釋,方法注釋.
這在創建一個類時,選中"Generate comments"checkbox框。即可在新建的類中加入你自定義的注釋。

如我把自己的文件注釋設成:
/*
* 類名 ${file_name}
* 說明 description of the class
* 創建日期 ${date}
* 作者 jiangjf
* 版權 ***
* 更新時間 $$Date$$
* 標簽 $$Name$$
* CVS版本 $$Revision$$
* 最后更新者 $$Author$$
*/
類注釋:選擇"Comments"->"Types"
/**
*
* ${tags}
* 功能說明 : 請補充
*/
posted on 2008-01-21 15:05
分享愛的空間 閱讀(5624)
評論(0) 編輯 收藏