我的 eclipse 具有以下代码模板 -> 注释 -> 类型:
/**
* @author ${user}
*
* ${tags}
*/
类的时候
public class MyProtocol<T extends ProtocolContext> extends Protocol<ExtendProtocolContext> {
当我向类添加评论时
/**
* @author user
*
* @param <T>
*/
我没有找到@param
用于How to Write Doc Comments中的类
@param (methods and constructors only)
关于方法为
* @param text the text of the tool tip */ public void setToolTipText(String text) {
应该@param
类里面也存在吗?如果不是,是 Eclipse 问题吗?
最佳答案
根据此:
https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#@param
它也应该用于类:
/**
* @param <E> Type of element stored in a list
*/
public interface List<E> extends Collection<E> {
}
最新文档中也是这样:
https://docs.oracle.com/en/java/javase/11/docs/specs/doc-comment-spec.html
关于java - 类上的@param javadoc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53611956/