是否可以在JavaDoc中重用@param描述? [英] Is it possible to re-use @param descriptions in JavaDoc?
本文介绍了是否可以在JavaDoc中重用@param描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个用于编码URI的便捷类.在其中,我创建了三种方法,这些方法取决于我需要的具体程度.我想知道在这种情况下是否使用JavaDoc重用@param
描述? (我还没找到)
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);
}
}
}
推荐答案
否.复制适用于覆盖的方法,但不适用于重载的方法. http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javadoc.html#inheritingcomments
No. Copying works for overridden, but not for overloaded methods. http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javadoc.html#inheritingcomments
这篇关于是否可以在JavaDoc中重用@param描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文