javadoc属性的参数
问题描述:
我有一个方法接受Properties
对象。是否有记录的方式在Javadoc的性能,如以标准的方式:javadoc属性的参数
/**
* @param props containing the following optional configuration props
* "one" -> defaults "hello"
* "two" -> defaults "bye"
*/
public readProps(Properties props) {
one = props.getProperty("one", "hello");
two = props.getProperty("two", "bye");
}
答
我不认为有记录这些信息的标准方式。不过,我会在说明中记录它,而不是在@param
标签下。 @param
标签应该是参数的简短描述,较长的文字可以放在其他地方。例如:
/**
* Reads props.
* A {@link Properties} object is passed to this method containing the
* following properties:
* <dl>
* <dt>one</dt>
* <dd>first property, defaults to <code>"hello"</code></dd>
* <dt>two</dt>
* <dd>second property, defaults to <code>"bye"</code></dd>
* </dl>
*
* @param props the properties
*/
public void readProps(Properties props) { ... }