What does the @ character of the Android source mean?

Source: Internet
Author: User
Tags abstract

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>
Related Article

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.