如何使用 JavaDoc 编写动作侦听器

How to JavaDoc an Action Listener

我有一个 ActionListener:

private ActionListener someAction = new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("Hello World");
    }
}

我将如何为 JavaDoc 评论这个。我想我有三个选择:

最好在哪里添加我的 JavaDoc 注释?

你不应该记录匿名内部 类 因为 JavaDoc 工具会忽略它。

The Javadoc tool does not directly document anonymous classes -- that is, their declarations and doc comments are ignored. If you want to document an anonymous class, the proper way to do so is in a doc comment of its outer class, or another closely associated class.

来自Java Docs