简体   繁体   English

Javadoc用于匿名对象的方法

[英]Javadoc for method of anonymous object

What is the best way to properly and usefully document a function of an anonymous object? 正确有用地记录匿名对象功能的最佳方法是什么? I am doing some programming with Soar (API here ), and have code that looks something like this: 我正在使用Soar( 这里的 API)进行一些编程,并且代码看起来像这样:

/**
 * 
 * @return handler that does blah
 */
public static RhsFunctionInterface functionBlah() {
    return new Kernel.RhsFunctionInterface() {
        /**
         * Does blah
         */
        @Override
        public String rhsFunctionHandler(int eventID, Object data,
                String agentName, String functionName, String arguments) {
            return null;
        }
    };
}

When it is important to know what the function of the returned object does, what it expects for parameters, etc., I'm not sure what to write down. 当重要的是知道返回的对象的功能是什么,它对参数等的期望是什么时,我不知道该写下什么。 Eclipse seems to ignore the javadoc's method, and I really don't want to write separate classes for each of the handlers just for documentation purposes. Eclipse似乎忽略了javadoc的方法,我真的不想为每个处理程序编写单独的类,仅用于文档目的。

The method should not need any documentation at all, as it's the implementation of an interface, and that interface should be documented. 该方法根本不需要任何文档,因为它是接口的实现,并且应该记录该接口。 The implementation of an interface behaves according to that. 接口的实现表现如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM