如何在 javadoc 中显示构造函数注释?
How do I show constructor comments within javadocs?
我有一个 class,它有一个带有 getter 和 setter 的构造函数,需要为它们创建一个 javadoc。
当我制作 javadoc 时,getter 和 setter 都有他们的评论,但由于某种原因,构造函数没有出现在 javadoc 中。注意:我正在 CMD 中创建 javadoc。我已经尝试更改 HTML 版本,但仍然一无所获
这是 class 的样子:
/**
* PersonalDetails class
*
* <p>Details the general information of a person involved in Saint Louis
University
*/
public class PersonalDetails {
private String name;
/**
* Creates a person with the specified characteristics
* @param name a String containing the name of the person
* @param sy a String specifying the current school year
* @param idNo a String containing the id number of the person
*/
PersonalDetails(String name, String sy, String idNo){
this.name = name;
this.sy = sy;
this.idNo = idNo;
}
/**
* Registers the name of the person
* @param name a String containing the name of the person
*/
public void setName(String name) {
this.name = name;
}
/**
* Retrieves the name of the person
* @return a String representing the name of the person
*/
public String getName() {
return name;
}
}
我需要在 javadoc 中显示构造函数 PersonalDetails 的块注释。
要么public
public PersonalDetails(String name, String sy, String idNo){
或配置 Javadoc,它也记录了您的包可见构造函数。
使用 -package
flag 调用 javadoc,因此它包含包私有 API 成员。
-package
Shows only package, protected, and public classes and members.
我有一个 class,它有一个带有 getter 和 setter 的构造函数,需要为它们创建一个 javadoc。
当我制作 javadoc 时,getter 和 setter 都有他们的评论,但由于某种原因,构造函数没有出现在 javadoc 中。注意:我正在 CMD 中创建 javadoc。我已经尝试更改 HTML 版本,但仍然一无所获
这是 class 的样子:
/**
* PersonalDetails class
*
* <p>Details the general information of a person involved in Saint Louis
University
*/
public class PersonalDetails {
private String name;
/**
* Creates a person with the specified characteristics
* @param name a String containing the name of the person
* @param sy a String specifying the current school year
* @param idNo a String containing the id number of the person
*/
PersonalDetails(String name, String sy, String idNo){
this.name = name;
this.sy = sy;
this.idNo = idNo;
}
/**
* Registers the name of the person
* @param name a String containing the name of the person
*/
public void setName(String name) {
this.name = name;
}
/**
* Retrieves the name of the person
* @return a String representing the name of the person
*/
public String getName() {
return name;
}
}
我需要在 javadoc 中显示构造函数 PersonalDetails 的块注释。
要么public
public PersonalDetails(String name, String sy, String idNo){
或配置 Javadoc,它也记录了您的包可见构造函数。
使用 -package
flag 调用 javadoc,因此它包含包私有 API 成员。
-package
Shows only package, protected, and public classes and members.