title: Limiting custom annotation for Spring application
body: <p>I want to create a custom spring annotation which will work under some conditions or parameters. But as a business constraint I need to share the library which has Genre annotation to all my applications. Is it possible to configure my annotation for limiting to some of my applications like @Profile annotation? </p>
  
  <pre><code>@Target({ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME)
  @Qualifier
  public @interface Genre {
    String value();
  }
  </code></pre>
  
  <p>and its usage</p>
  
  <pre><code>public class MovieRecommender {
  @Autowired
  
     @Genre("Action")
     private MovieCatalog actionCatalog; 
  
     private MovieCatalog comedyCatalog;
  
     @Autowired
     public void setComedyCatalog(@Genre("Comedy") MovieCatalog comedyCatalog) { 
        this.comedyCatalog = comedyCatalog;
     }
  // ...
  }
  </code></pre>