久久久久久久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>
                            主站蜘蛛池模板: 国产高清精品在线 | 久在草 | 一区二区三区免费 | 欧美激情 亚洲 | 在线观看av不卡 | 日韩一三区 | 久久人 | 国产毛片久久久 | 在线色网站| 亚洲成av人片在线观看 | 午夜视频在线免费观看 | 亚洲精品久久久久avwww潮水 | xxx.在线观看 | 国产9999精品| 亚洲一区免费视频 | 麻豆一区二区三区 | 国产亚洲一区二区三区在线 | 91视视频在线观看入口直接观看 | 在线播放亚洲 | 欧美成人精品激情在线观看 | 高清黄色网址 | 黄网站免费在线看 | 欧美精品在线一区二区三区 | 一区二区三区在线 | 中文字幕一区二区三区不卡 | 一区二区三区国产 | 视频二区 | 精品综合| 日韩精品1区2区3区 成人黄页在线观看 | 亚洲视频区 | 中文字幕一区二区三区不卡 | 最近最新中文字幕 | 国产精品久久久久久久久久 | 日本成人片在线观看 | 欧美日韩网站 | 亚洲精品中文字幕在线观看 | 精品久久久久久 | 99精品电影| 欧美一区二区在线免费观看 | 久久久久亚洲精品国产 | 天天操操操操操 |