如何在 Eclipse 中使用 JavaDocs 来显示条件 return 语句?

How can I use JavaDocs in Eclipse to show conditional return statements?

我有一个简单的方法 "ValidateUser" returns 一个不同的字符串,具体取决于用户是否已成功登录。

现在我刚刚记录了第一个可能的输出。

/**
*
*@param user the username of the user
*@param password the password of the user
*@return    True <br>
*           User_First_Name<br>
*           User_Last_Name<br>
*           Num_Records
*
*/

使用 javadoc 显示所有可能输出的最佳方式是什么?

一个选择是保持@return简单,并将详细信息放在方法文档中。

例如:

/**
* Validates the user.
* <p>If successful, returns a string including these lines:</p>
* <blockquote>
* TRUE
* User_First_Name
* User_Last_Name
* Num_Records
* </blockquote>
* <p>Otherwise, returns "FALSE" or "FAILED".</p>
* @param user the username of the user
* @param password the password of the user
* @return  If successful, the multi-line string described above, 
*    beginning with "TRUE". Returns "FALSE" if the user credentials 
*    are invalid. Returns "FAILED" if the operation failed for any 
*    reason (e.g., can't connect to the server, internal server error).
*/