Is it possible to re-use @param descriptions in JavaDoc?

六眼飞鱼酱① 提交于 2019-12-20 02:52:38

问题


I have a convenience class for encoding URI's. In it I've created three methods which I use depending on how specific I need to be. I'm wondering if there is a smart way to re-use @param descriptions in this case using JavaDoc? (I haven't found any)

public class URLCreator {
    public static String getURLString(String host, int port, String path) {
        return getURLString("http", host, port, path, null);
    }
    public static String getURLString(String scheme, String host, int port, String path) {
        return getURLString(scheme, host, port, path, null);
    }
    public static String getURLString(String scheme, String host, int port, String path, String fragment) {
        try {
            URI uri = new URI(scheme, null, host, port, path, null, fragment);
            return uri.toString();
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }
}

回答1:


No. Copying works for overridden, but not for overloaded methods. http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javadoc.html#inheritingcomments



来源:https://stackoverflow.com/questions/1036565/is-it-possible-to-re-use-param-descriptions-in-javadoc

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