Is there a javadoc tag for documenting generic type parameters?
I've been looking through the javadoc documentation on Sun's site, trying to find if there's a javadoc tag which can be used to document a class or method's generic type signature.
Something like @typeparam
, similar to the usual @param
, but applicable to types as well as methods,e.g.
/**
* @typeparam T This describes my type parameter
*/
class MyClass<T> {
}
I suspect there is no such tag - I can find no mention of it anywhere, and the JavaSE API docs don't show any sign of it, but it seems like an odd omission. Can someone put me right?
Solution 1:
It should be done just like this:
/**
* @param <T> This describes my type parameter
*/
class MyClass<T>{
}
Source
Solution 2:
Yes. Just use the @param tag, and include angle brackets around the type parameter.
Like this:
/**
* @param <T> This describes my type parameter
*/