是否可以将代码段放在参数的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>
*/
答案 0 :(得分:0)
你快到了。试试这个:
/**
* 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>
*/