久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='5V6nH'></small><noframes id='5V6nH'>

    1. <i id='5V6nH'><tr id='5V6nH'><dt id='5V6nH'><q id='5V6nH'><span id='5V6nH'><b id='5V6nH'><form id='5V6nH'><ins id='5V6nH'></ins><ul id='5V6nH'></ul><sub id='5V6nH'></sub></form><legend id='5V6nH'></legend><bdo id='5V6nH'><pre id='5V6nH'><center id='5V6nH'></center></pre></bdo></b><th id='5V6nH'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5V6nH'><tfoot id='5V6nH'></tfoot><dl id='5V6nH'><fieldset id='5V6nH'></fieldset></dl></div>

      <legend id='5V6nH'><style id='5V6nH'><dir id='5V6nH'><q id='5V6nH'></q></dir></style></legend>
          <bdo id='5V6nH'></bdo><ul id='5V6nH'></ul>
        <tfoot id='5V6nH'></tfoot>

      1. Java 中如何以及在何處使用注解?

        How and where are Annotations used in Java?(Java 中如何以及在何處使用注解?)
        <tfoot id='tNSRx'></tfoot>
          <bdo id='tNSRx'></bdo><ul id='tNSRx'></ul>

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

              <tbody id='tNSRx'></tbody>

          1. <legend id='tNSRx'><style id='tNSRx'><dir id='tNSRx'><q id='tNSRx'></q></dir></style></legend>
            • <i id='tNSRx'><tr id='tNSRx'><dt id='tNSRx'><q id='tNSRx'><span id='tNSRx'><b id='tNSRx'><form id='tNSRx'><ins id='tNSRx'></ins><ul id='tNSRx'></ul><sub id='tNSRx'></sub></form><legend id='tNSRx'></legend><bdo id='tNSRx'><pre id='tNSRx'><center id='tNSRx'></center></pre></bdo></b><th id='tNSRx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tNSRx'><tfoot id='tNSRx'></tfoot><dl id='tNSRx'><fieldset id='tNSRx'></fieldset></dl></div>

                  本文介紹了Java 中如何以及在何處使用注解?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我們可以使用注解的主要領域有哪些?該功能是否可以替代基于 XML 的配置?

                  What are the major areas that we can use Annotations? Is the feature a replacement for XML based configuration?

                  推薦答案

                  注解是meta-meta-objects,可以用來描述其他meta-objects.元對象是類、字段和方法.向對象詢問其元對象(例如 anObj.getClass() )稱為 introspection.內省可以更進一步,我們可以詢問元對象它的注釋是什么(例如 aClass.getAnnotations).自省和注釋屬于所謂的反射元編程.

                  Annotations are meta-meta-objects which can be used to describe other meta-objects. Meta-objects are classes, fields and methods. Asking an object for its meta-object (e.g. anObj.getClass() ) is called introspection. The introspection can go further and we can ask a meta-object what are its annotations (e.g. aClass.getAnnotations). Introspection and annotations belong to what is called reflection and meta-programming.

                  注釋需要以一種或另一種方式解釋才能有用.IDE 或編譯器可以在開發時 或由框架在運行時 解釋注釋.

                  An annotation needs to be interpreted in one way or another to be useful. Annotations can be interpreted at development-time by the IDE or the compiler, or at run-time by a framework.

                  注解處理是一種非常強大的機制,可以以多種不同的方式使用:

                  Annotation processing is a very powerful mechanism and can be used in a lot of different ways:

                  • 描述元素的約束或使用:例如@Deprecated、@Override@NotNull
                  • 描述元素的性質",例如@Entity、@TestCase、@WebService
                  • 描述一個元素的行為:@Statefull, @Transaction
                  • 描述如何處理元素:@Column, @XmlElement

                  在所有情況下,注釋都用于描述元素并闡明其含義.

                  In all cases, an annotation is used to describe the element and clarify its meaning.

                  在 JDK5 之前,現在用注釋表示的信息需要存儲在其他地方,并且經常使用 XML 文件.但是使用注解更方便,因為它們屬于 Java 代碼本身,因此比 XML 更容易操作.

                  Prior to JDK5, information that is now expressed with annotations needed to be stored somewhere else, and XML files were frequently used. But it is more convenient to use annotations because they will belong to the Java code itself, and are hence much easier to manipulate than XML.

                  注解的使用:

                  • 文檔,例如XDoclet
                  • 編譯
                  • 集成開發環境
                  • 測試框架,例如JUnit
                  • IoC 容器,例如作為春天
                  • 序列化,例如XML
                  • 面向方面的編程 (AOP),例如Spring AOP
                  • 應用服務器,例如EJB 容器、Web 服務
                  • 對象關系映射 (ORM),例如休眠,JPA
                  • 還有更多...

                  ...看看項目 Lombok 的例子,它使用注釋來定義如何生成 equalshashCode 方法.

                  ...have a look for instance at the project Lombok, which uses annotations to define how to generate equals or hashCode methods.

                  這篇關于Java 中如何以及在何處使用注解?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數的三元表達式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 char 原語?)
                  • <small id='S5Xox'></small><noframes id='S5Xox'>

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

                    1. <tfoot id='S5Xox'></tfoot>

                      <legend id='S5Xox'><style id='S5Xox'><dir id='S5Xox'><q id='S5Xox'></q></dir></style></legend>
                        <tbody id='S5Xox'></tbody>
                        <bdo id='S5Xox'></bdo><ul id='S5Xox'></ul>
                            主站蜘蛛池模板: 久久精品久久精品 | 亚洲一区二区三区高清 | 中文字幕在线观看 | 国产一区二区三区四区 | 91原创视频 | 亚洲一区二区av | 日本免费一区二区三区四区 | 中文字幕人成乱码在线观看 | 欧美一级免费看 | 国产精品美女www爽爽爽 | 99亚洲精品 | .国产精品成人自产拍在线观看6 | 国产一区二区三区日韩 | 久久精品免费观看 | 97色在线观看免费视频 | 午夜在线视频 | 黄色一级电影在线观看 | 日韩国产一区二区三区 | 国产精品视频播放 | 国产探花在线精品一区二区 | 日韩欧美一级 | 亚洲午夜精品久久久久久app | 国产一区在线免费 | 性欧美xxxx| 狠狠干综合视频 | 天天看天天干 | 免费啪啪 | 久久久久久综合 | 国产高清一区二区三区 | 亚洲91av| 一区二区在线 | 69av在线视频| 午夜网站视频 | 国产精品日韩欧美一区二区三区 | 婷婷综合色 | 免费一区| 亚洲一区二区三区视频 | 成人av影院 | 精品一区二区三区不卡 | www.国产.com| 日本不卡一区二区 |