(Reprinted please indicate the source: http://blog.csdn.net/buptgshengod) 1. Background
In the android source code, we can see various characters starting with @, most of which appear in comments, as shown in
But do not underestimate their functions. When I compiled the source code yesterday, I reported an error in a "@ link". The following summarizes the meaning of the commonly used @ characters. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPGgxPjIu19y94caqPC9oMT4KPHA + Asn + CjxwcmUgY2xhc3M9 "brush: java;"> @ hide
The @ hide character usually appears in the comments section at the beginning of the source code class or method, indicating that the method or class is hidden in the sdk provided by google and cannot be called directly. If you want to use it, you can use reflection, source code compilation, and other methods.
(2) @ link
@link
The @ link character can be used independently, for example, @ link something or @ link sth1 # sth2. It is mainly used to generate javadoc files. When we remove this character, will it affect compilation? I am still experimenting with it and will post the result later.
(3) @ param
@param
@ Param is frequently used. It is also one of the characters in javadoc, which is a text record. It is mainly used to comment out the functions of parameters used in the following methods.
/***@param context*@param attrs*/Public DotView(Context context, Attribute attrs) { super(context, attrs); setFocusAbleInTouch(true);}
(4) @ see
@see
@ See prompts the user about the related classes or functions.
public abstract class MyBase { protected abstract void myFunc();}class MyImpl extends MyBase { /** * @see MyBase#myFunc() */ @Override protected void myFunc() { .. }}