Javadoc {@value} 不适用于常量

Javadoc {@value} not working for Constants

我正在尝试将 Javadoc 应用于常量变量。

代码:

private final String playerName;

/**
 * The value of MAX_PLAYER_HEALTH is {@value} 
 */
 
private static final Integer MAX_PLAYER_HEALTH = 200;

/**
 * The value of DEFAULT_PLAYER_LIVES {@value}
 */
private static final Integer DEFAULT_PLAYER_LIVES = 3;

private Integer health = MAX_PLAYER_HEALTH;
private int lives = DEFAULT_PLAYER_LIVES;

有了这个,一旦我生成了 Javadoc,我就得到了一个错误:

C:\Users\AmirS\OneDrive\Documents\NetBeansProjects\TheTower\src\PlayerSingleton\PlayerSingleton.java:22: error: {@value} not allowed here
     * The value of DEFAULT_PLAYER_LIVES {@value}
C:\Users\AmirS\OneDrive\Documents\NetBeansProjects\TheTower\src\PlayerSingleton\PlayerSingleton.java:18: error: {@value} not allowed here
     * The value of MAX_PLAYER_HEALTH is {@value}

我正在关注 Oracle 上的 reference guide。我做错了什么?

更新代码:将 Integer 更改为 int{@value} 只能与基本类型一起使用,不能与 Integer.

等包装器一起使用

问题是在常量变量中使用 Integer 而不是 int