1. Background
In the Android code we can see a variety of characters that start with @, most of them appear in the comments, as shown in the following figure
But do not underestimate their role, yesterday when I compiled the source code, in a "@link" where the error, the following summary of the commonly used @ character meaning.
2. Summary article
(1) The most annoying @ character
<span style= "FONT-SIZE:18PX;" > @hide </span>
@hide characters typically appear in the initial annotation section of the source class or method, indicating that the method or class is hidden in the SDK provided by Google and cannot be invoked directly. If you want to use can be used to reflect, compile the source code and so on.
(2) @link
<span style= "FONT-SIZE:18PX;" > @link </span>
@link characters can be used alone such as: @link sth or @link sth1#sth2. is used primarily to generate Javadoc file usage. When we remove this character will have an effect on the compilation I am still experimenting and will post the results later.
(3) @param
<span style= "FONT-SIZE:18PX;" > @param </span>
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/
@param appears most frequently, and it is also one of the characters that Javadoc is a text record. This is primarily used to annotate the functionality of the parameters used in the following methods.
<span style= "FONT-SIZE:18PX;" >/**
* @param context
* @param attrs
/Public Dotview (context, Attribute attrs) {
Super (context, attrs);
Setfocusableintouch (true);
</span>
(4) @see
<span style= "FONT-SIZE:18PX;" > @see </span>
@see prompts the user about the class or function information.
<span style= "FONT-SIZE:18PX;" >public abstract class MyBase {
protected abstract void MyFunc ();
}
Class Myimpl extends MyBase {
/**
* @see mybase#myfunc () */
@Override
protected void MyFunc () { .. }
} </span>