Limited options @see and @link javadoc

How do you refer to a method in javadoc @see and @link if they have parameters like Bonded?

Example:

public class A { } public interface I<J> { } public class F { public static <T extends A & I<B>, B> String newThing(T bondedTypeObject, List<B> list) { /*...*/ } public static <T extends A & I<B>, B> String newThing(T bondedTypeObject, B anotherObject) { /*...*/ } /** * Uses {@link #newThing(T bondedTypeObject, List<B> list) newThing} to create a super new thing. */ public static String createSuperNewThing(...) { return newThing(...); } } 

How do you write javadoc link for createSuperNewThing to the correct newThing method?

Oracle documentation is not very clear in such cases: http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#specifyingname

+4
source share
2 answers

You need to specify erasure arguments, for example:

 /** * Uses {@link newThing(A bondedTypeObject, List list)} to create... */ 

Note that erasing a parameter of type T extends SomeClass & SomeInterface is equal to SomeClass .

+5
source

Here is an example from Oracle Java docs. To associate this method with collections

 static <K,V> Map<K,V> synchronizedMap(Map<K,V> m) 

you would use the link:

 {@link Collections.html#synchronizedMap(Map)} 
+2
source

All Articles