在我们的项目中,我们将编写API javadocs。在文档注释中,除了方法细节之外,我们还要编写历史详细信息。例如,如果修改方法以修复特定问题,我们希望记录问题的详细信息以及该方法的javadoc注释。
/**
* Displays the details for a valid registered customer against the specified <code>Integer customerId</code>.<br>
* Responsible to check the existance of the customer before sending back the information for the "Customer Reference" screen.
*
* @param customerId the customer id to fetch the details for
* @return <code>jsp</code> file name for "Customer Reference" screen along with Customer details
*
* BTS-1947 | custom fields not displayed correctly | 25-10-2016 | Vaibhav
*/
public String displayCustomerInfo(Integer customerId) {
问题是,我们不希望使用javadocs工具在生成的javadocs中显示部分BTS-1947 | custom fields not displayed correctly | 25-10-2016 | Vaibhav
。是否可以这样做,还是有更好的方法来维护javadocs的更新历史记录?
答案 0 :(得分:1)
如果您使用的是jdk1.7,则可以使用自定义标签。当javadoc编译时,它不会显示任何带有自定义标记的内容。它会给你一个警告。 例如:
/**
* Displays the details for a valid registered customer against the specified <code>Integer customerId</code>.<br>
* Responsible to check the existance of the customer before sending back the information for the "Customer Reference" screen.
*
* @param customerId the customer id to fetch the details for
* @return <code>jsp</code> file name for "Customer Reference" screen along with Customer details
*
* @custom BTS-1947 | custom fields not displayed correctly | 25-10-2016 | Vaibhav
*/
public String displayCustomerInfo(Integer customerId) {
使用自定义标记编译javadoc时,jdk1.8会出错。
希望这有帮助,请告诉我。