title: Java annotations: pass value of annotation attribute to another annotation
body: <p>I have interface <strong>Resource</strong> and several classes implementing it, for example <strong>Audio</strong>, <strong>Video</strong>... Further, I have created custom annotation <strong>MyAnnotation</strong> with Class type param:</p>
  
  <pre><code> @MyAnnotation(type = Audio.class)
   class Audio {
   ...
   }
  
   @MyAnnotation(type = Video.class)
   class Video{
   ...
   }
  </code></pre>
  
  <p>In some other place in code I have to use Interface <strong>Resource</strong> as a returned type:</p>
  
  <pre><code>public class Operations&lt;T extends Resource&gt; {
      ....
      @OtherAnnotation(type = Audio.class (if audio), type = Video.class (if video) )
      T getResource();
      ....
  }
  </code></pre>
  
  <p>The question is how to appropriatelly annotate annotation <strong>@OtherAnnotation</strong> depending of what kind of Resource type will be returned ?</p>