2

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 Answers1

0

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

Mikko Maunu
  • 41,366
  • 10
  • 132
  • 135
  • Yep, I know about the inheritence behavior. I select it as the preferred answer for the "No." part. :-) –  Jun 30 '09 at 17:53
  • Try the @see tag: http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#multiple@see – Eran Medan Nov 17 '12 at 03:25