久久久久久久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中有沒(méi)有類(lèi)似注解繼承的東西?

        Is there something like Annotation Inheritance in java?(java中有沒(méi)有類(lèi)似注解繼承的東西?)
            <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中有沒(méi)有類(lèi)似注解繼承的東西?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在探索注解并發(fā)現(xiàn)一些注解似乎在它們之間具有層次結(jié)構(gòu).

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

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

                  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();
                  }
                  

                  這將是常見(jiàn)的注釋:

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

                  在上面的示例中,我希望 Move 繼承方法 3,但我收到一條警告,指出擴(kuò)展對(duì)注釋無(wú)效.我試圖讓一個(gè)注釋擴(kuò)展一個(gè)公共基礎(chǔ),但這不起作用.這甚至可能還是只是一個(gè)設(shè)計(jì)問(wèn)題?

                  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?

                  推薦答案

                  很遺憾,沒(méi)有.顯然,它與讀取類(lèi)上的注釋而不一直加載它們的程序有關(guān).請(qǐng)參閱 為什么不能在 Java 中擴(kuò)展注釋?

                  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.

                  此外,除非您需要這些方法進(jìn)行交互,否則您可以將注釋堆疊在您的類(lèi)上:

                  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?

                  這篇關(guān)于java中有沒(méi)有類(lèi)似注解繼承的東西?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

                      <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 | 九九九国产 | 在线a视频 | 久久国产精品免费 | 欧美日韩高清 | 亚洲欧美在线观看 | www.av在线播放 | 久久怡红院 | 成人在线国产 | 狠狠干在线视频 | 午夜拍拍 | 欧美日韩国 | 亚洲一区精品视频 | 欧美国产日韩一区二区 | 日韩精品一区二区在线 | 一区二区三区在线观看免费 | 免费亚洲婷婷 | 国产一区二区三区免费 | 黄色片在线播放 | 国产一区二区三区在线看 | 日本精品视频在线 | 在线观看欧美日韩视频 | 精品视频免费 | 国产午夜三级 | 天天色天天干天天 | 亚洲欧美综合另类 | 天天综合天天做天天综合 | 亚洲小视频在线观看 | 久久不射网 | 日韩黄色影院 | 亚洲一级免费视频 | 久久在线免费视频 | av老司机在线观看 | 四虎在线免费观看视频 | 国产91清纯白嫩初高中在线观看 | 亚洲成a人片 | 天天澡天天狠天天天做 | 国产香蕉av | 国产精品第一区 | 久久精品一区二区三区不卡牛牛 |