annotation手册(annotation手册).doc

  1. 1、本文档共22页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
annotation手册(annotation手册)

annotation手册(annotation手册) What exactly is Annotation? Annotation provides a way to associate any information with program elements or any metadata (metadata). In some ways, annotation is used as a modifier and applied to packages, types, constructs, methods, methods, member variables, parameters, declarations of local variables. This information is stored in the name=value structure of the annotation. The annotation type is an interface that provides access to its information by way of java reflection of API. Annotation can be used to correlate any information to a program element (class, method, member variable, etc.). It is important to note that there is a basic underlying rule: annotaion does not affect the execution of program code; the execution of code is consistent regardless of the addition or deletion of annotation. In addition, although some annotation are reflected by the Java, the API method is accessed at run time, and the Java interpreter ignores these annotation at work. It is because of the Java virtual machine to ignore annotation, leading to the annotation type is no effect in the code; only through a supporting tool can access and processing of information in the annotation type. The standard annotation and meta-annotation types will be covered in this article, and the tools that accompany these annotation types are Java compilers (of course, to handle them in some special way). For these reasons, annotation is very handy in use. A local variable can be marked as a annotation type named after NonNull as an assertion that this local variable cannot be assigned a null value. And we can write a annotation code analysis tool to parse the code with the previous variables and try to validate the assertion. Of course, the code doesnt have to be written by itself. In the JDK after installation, can be found in the JDK/bin directory called apt tool, it provides a framework for dealing with annotation: it started scanning the source code annotation, we de

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档