Summary of @ characters in the android source code

Source: Internet
Author: User

(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() { .. }}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.