Multiple annotations of the same type on one element?

前端 未结 8 1277
再見小時候
再見小時候 2020-11-30 21:39

I\'m attempting to slap two or more annotations of the same type on a single element, in this case, a method. Here\'s the approximate code that I\'m working with:

         


        
8条回答
  •  离开以前
    2020-11-30 22:22

    combining the other answers into the simplest form ... an annotation with a simple list of values ...

    @Foos({"one","two"})
    private String awk;
    
    //...
    
    public @interface Foos{
        String[] value();
    }
    

提交回复
热议问题