• <bdo id='cl3dS'></bdo><ul id='cl3dS'></ul>
      <tfoot id='cl3dS'></tfoot>

    1. <i id='cl3dS'><tr id='cl3dS'><dt id='cl3dS'><q id='cl3dS'><span id='cl3dS'><b id='cl3dS'><form id='cl3dS'><ins id='cl3dS'></ins><ul id='cl3dS'></ul><sub id='cl3dS'></sub></form><legend id='cl3dS'></legend><bdo id='cl3dS'><pre id='cl3dS'><center id='cl3dS'></center></pre></bdo></b><th id='cl3dS'></th></span></q></dt></tr></i><div id='cl3dS'><tfoot id='cl3dS'></tfoot><dl id='cl3dS'><fieldset id='cl3dS'></fieldset></dl></div>
    2. <small id='cl3dS'></small><noframes id='cl3dS'>

        <legend id='cl3dS'><style id='cl3dS'><dir id='cl3dS'><q id='cl3dS'></q></dir></style></legend>

      1. 注释 SOURCE 保留政策

        时间:2023-09-28

              • <legend id='C62nb'><style id='C62nb'><dir id='C62nb'><q id='C62nb'></q></dir></style></legend>
                  <tbody id='C62nb'></tbody>
                <i id='C62nb'><tr id='C62nb'><dt id='C62nb'><q id='C62nb'><span id='C62nb'><b id='C62nb'><form id='C62nb'><ins id='C62nb'></ins><ul id='C62nb'></ul><sub id='C62nb'></sub></form><legend id='C62nb'></legend><bdo id='C62nb'><pre id='C62nb'><center id='C62nb'></center></pre></bdo></b><th id='C62nb'></th></span></q></dt></tr></i><div id='C62nb'><tfoot id='C62nb'></tfoot><dl id='C62nb'><fieldset id='C62nb'></fieldset></dl></div>
                  <bdo id='C62nb'></bdo><ul id='C62nb'></ul>

                  <tfoot id='C62nb'></tfoot>

                  <small id='C62nb'></small><noframes id='C62nb'>

                • 本文介绍了注释 SOURCE 保留政策的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  来自 Java 文档:

                  From the Java doc:

                  类:注释将由编译器记录在类文件中,但不需要在运行时由 VM 保留.

                  CLASS: Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time.

                  运行时间:注释将由编译器记录在类文件中,并在运行时由 VM 保留,因此可以反射性地读取它们.

                  RUNTIME: Annotations are to be recorded in the class file by the compiler and retained by the VM at run time, so they may be read reflectively.

                  来源:注释将被编译器丢弃.

                  SOURCE: Annotations are to be discarded by the compiler.

                  我了解 RUNTIME(为了使用带反射的注解)和 CLASS(对于编译器)的用法,但我不明白什么时候可以使用

                  I understand the usages of RUNTIME (in order to use annotation with reflection) and CLASS (for the compiler) but I don't understand when it can be usefull to use

                  @Retention(RetentionPolicy.SOURCE)

                  @Retention(RetentionPolicy.SOURCE)

                  你能解释一下吗?

                  推荐答案

                  像@SuppressWarnings、@Override 这样的东西是编译器使用的注解——在运行时不需要.对于那些 RetentionPolicy.SOURCE 是有意义的.注释也可用于生成代码(查看 Spring ROO)——在运行时也不需要此类注释.

                  Things like @SuppressWarnings, @Override are annotations used by the compiler - not needed at runtime. For those RetentionPolicy.SOURCE would make sense. Also annotations can be used to generate code (look at Spring ROO) - such annotation are also not required at run time.

                  这篇关于注释 SOURCE 保留政策的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 Annotation Processor for java 中发现方法调用的类 下一篇:Jaxb:在同一个包中解组具有多个命名空间的 xml

                  相关文章

                  最新文章

                  <small id='lqNsE'></small><noframes id='lqNsE'>

                  1. <legend id='lqNsE'><style id='lqNsE'><dir id='lqNsE'><q id='lqNsE'></q></dir></style></legend>

                      <i id='lqNsE'><tr id='lqNsE'><dt id='lqNsE'><q id='lqNsE'><span id='lqNsE'><b id='lqNsE'><form id='lqNsE'><ins id='lqNsE'></ins><ul id='lqNsE'></ul><sub id='lqNsE'></sub></form><legend id='lqNsE'></legend><bdo id='lqNsE'><pre id='lqNsE'><center id='lqNsE'></center></pre></bdo></b><th id='lqNsE'></th></span></q></dt></tr></i><div id='lqNsE'><tfoot id='lqNsE'></tfoot><dl id='lqNsE'><fieldset id='lqNsE'></fieldset></dl></div>

                        <bdo id='lqNsE'></bdo><ul id='lqNsE'></ul>
                      <tfoot id='lqNsE'></tfoot>