brief discussion on the function of @param annotation and @see annotation in Java
Author: Java Small bo font: [Increase decrease] Type: Reprint time: 2015-12-21 I want to comment this article mainly introduces the function of @param annotation and @see annotation in Java, the annotation function is similar to the annotation in the usual code, the friend who need can refer to the following @ param
The @ param tag can archive a single parameter of a method or constructor, or an archive class, interface, and the type parameters of a generic method. When using the @ param tag, we should use a label for each parameter of the method. The first word of each paragraph is treated as a parameter name, and the remainder is treated as a description of it:?
| 1 |
@param max The maximum number of words to read. |
When archiving type parameters, we should add < to both sides of the type parameter name:?
| 1 |
@param an e element type of this List |
However, type parameters usually do not require an explicit document, because they are very significant.
@
The @ can tag creates cross-references that link to other Javadoc documents. We can name any identifiers after the tag, although we have to qualify them adequately. For example, you can usually name a member of a class by using its simple name, but if that member is an overloaded method, we must specify the overloaded version of the method by enumerating the types of the arguments. We can use unqualified names to specify the interfaces or classes within the current package, but you must use the fully qualified name to specify the type in the other package. We can specify a member of a type by using # before the member name. The following are all valid @-to-tag formats:?
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
@see #getName @see Attr @see com.magic.attr.Attr |