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

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

        <bdo id='WtAgk'></bdo><ul id='WtAgk'></ul>

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

        java中有沒有類似注解繼承的東西?

        Is there something like Annotation Inheritance in java?(java中有沒有類似注解繼承的東西?)
            <tbody id='ahYs4'></tbody>
          <tfoot id='ahYs4'></tfoot>

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

              <i id='ahYs4'><tr id='ahYs4'><dt id='ahYs4'><q id='ahYs4'><span id='ahYs4'><b id='ahYs4'><form id='ahYs4'><ins id='ahYs4'></ins><ul id='ahYs4'></ul><sub id='ahYs4'></sub></form><legend id='ahYs4'></legend><bdo id='ahYs4'><pre id='ahYs4'><center id='ahYs4'></center></pre></bdo></b><th id='ahYs4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ahYs4'><tfoot id='ahYs4'></tfoot><dl id='ahYs4'><fieldset id='ahYs4'></fieldset></dl></div>
              <legend id='ahYs4'><style id='ahYs4'><dir id='ahYs4'><q id='ahYs4'></q></dir></style></legend>
              • <bdo id='ahYs4'></bdo><ul id='ahYs4'></ul>
                  本文介紹了java中有沒有類似注解繼承的東西?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在探索注解并發現一些注解似乎在它們之間具有層次結構.

                  I'm exploring annotations and came to a point where some annotations seems to have a hierarchy among them.

                  我正在使用注釋在后臺為卡片生成代碼.有不同的卡片類型(因此不同的代碼和注釋),但它們之間有一些共同的元素,如名稱.

                  I'm using annotations to generate code in the background for Cards. There are different Card types (thus different code and annotations) but there are certain elements that are common among them like a name.

                  @Target(value = {ElementType.TYPE})
                  public @interface Move extends Page{
                   String method1();
                   String method2();
                  }
                  

                  這將是常見的注釋:

                  @Target(value = {ElementType.TYPE})
                  public @interface Page{
                   String method3();
                  }
                  

                  在上面的示例中,我希望 Move 繼承方法 3,但我收到一條警告,指出擴展對注釋無效.我試圖讓一個注釋擴展一個公共基礎,但這不起作用.這甚至可能還是只是一個設計問題?

                  In the example above I would expect Move to inherit method3 but I get a warning saying that extends is not valid with annotations. I was trying to have an Annotation extends a common base one but that doesn't work. Is that even possible or is just a design issue?

                  推薦答案

                  很遺憾,沒有.顯然,它與讀取類上的注釋而不一直加載它們的程序有關.請參閱 為什么不能在 Java 中擴展注釋?

                  Unfortunately, no. Apparently it has something to do with programs that read the annotations on a class without loading them all the way. See Why is it not possible to extend annotations in Java?

                  但是,如果這些注解是 @Inherited.

                  However, types do inherit the annotations of their superclass if those annotations are @Inherited.

                  此外,除非您需要這些方法進行交互,否則您可以將注釋堆疊在您的類上:

                  Also, unless you need those methods to interact, you could just stack the annotations on your class:

                  @Move
                  @Page
                  public class myAwesomeClass {}
                  

                  有什么不適合你的原因嗎?

                  Is there some reason that wouldn't work for you?

                  這篇關于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 原語?)

                      <tbody id='anPVf'></tbody>
                      <bdo id='anPVf'></bdo><ul id='anPVf'></ul>

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

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

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

                            <tfoot id='anPVf'></tfoot>
                            主站蜘蛛池模板: 国产精品久久久久久婷婷天堂 | 一a级片 | 欧美性成人 | 欧美成人一区二免费视频软件 | 欧美天堂 | 久久久www成人免费精品 | 亚洲综合视频 | 国产农村妇女毛片精品久久麻豆 | 国产一区在线免费观看视频 | 草久在线视频 | 久久一二 | 精品成人| 亚洲黄色在线免费观看 | 高清18麻豆 | 欧美在线色 | 99精品视频一区二区三区 | 免费在线观看成人 | 国产中文字幕网 | 中文字幕亚洲视频 | 99精品久久 | 日韩一区二区在线免费观看 | 性色在线 | 日韩av在线一区 | 福利在线看 | 91久久精品一区二区二区 | 久在线| 欧美日韩1区2区3区 欧美久久一区 | 久久成人一区二区三区 | 91资源在线观看 | 日本免费视频在线观看 | 久久aⅴ乱码一区二区三区 亚洲国产成人精品久久久国产成人一区 | 日韩中文一区二区三区 | 国产免费av在线 | 精品亚洲一区二区三区 | 久久欧美精品 | 亚洲一区欧美一区 | 亚洲成人av| 久久久国产精品一区 | 日本色婷婷 | 蜜桃臀av一区二区三区 | 国产成人99av超碰超爽 |