Javadoc for method of anonymous object

此生再无相见时 提交于 2019-12-01 07:26:51

问题


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:

/**
 * 
 * @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.


回答1:


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.



来源:https://stackoverflow.com/questions/8797397/javadoc-for-method-of-anonymous-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!