Spring has its own Qualifier
annotation, I think it's equivalent to the javax.inject.Named
annotation, which in turn is a concrete qualifier in JSR-330.
So, I'm wondering which version of Spring, if any, supports Qualifier?
Here is my example usage, unfortunately it doesn't work with spring-context 3.0.5:
@Retention(RUNTIME)
@javax.inject.Qualifier
public @interface Version {
String value();
}
@Configuration
public class MyConfig {
@Bean("book-12") @Version("a") Book book12a() { ... }
@Bean("book-12") @Version("b") Book book12b() { ... }
}
@Component
public class UserClass {
@Inject @Named("book-12") Book anybook12;
@Inject @Named("book-12") @Version("b") Book book12_b;
}