是否可以将代码片段放入参数的 JavaDoc 中?我尝试了以下操作,但生成的文档中的代码片段未采用这种格式。
/**
* Description of method
*
* @param dataSourceProperties defines the properties of this datasource. At a minimum, the following should
* be provided
*
* <pre>
* {@code
* String driverClassName = 'com.mysql.jdbc.Driver';
* String url = 'jdbc:mysql://localhost/example';
* String username = 'root';
* String password = 'password';
* }
* </pre>
*/
最佳答案
你就快到了。试试这个:
/**
* Description of method
*
* @param dataSourceProperties defines the properties of this datasource. At a minimum, the following should
* be provided
*
* <pre>
* <code>
* String driverClassName = 'com.mysql.jdbc.Driver'
* String url = 'jdbc:mysql://localhost/example'
* String username = 'root'
* String password = 'password'
* </code>
* </pre>
*/
关于java - @param Javadoc 内的代码片段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24735958/