@param Javadoc中的代码片段

时间:2014-07-14 11:51:12

标签: java javadoc

是否可以将代码段放在参数的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>
 */

1 个答案:

答案 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>
 */