SpringSource/spring-framework — pull request #168 by olivergierke (2012-10-19 03:43:03+00:00)
Title: Allow usage of injection annotations as meta-annotations.

@Autowired and @Inject can now be used as meta-annotations to create
semantic annotations. Assume a library is exposing special primitive
values as Spring beans under registered names like 'foo.bar'. They could
be used by clients using @Value("foo.bar"), which is reasonable but error-
prone. After this change, the library can go ahead and define a special
annotation as follows:

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Value("foo.bar")
public @interface MySpecialValue { }

This allows clients to use @MySpecialValue for injection and thus prevent
potential typos. For @Autowired this essentially now allows for qualified
auto wiring being wrappable into a

@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Qualifier("myQualifier")
@Autowired
public @interface MyQualifiedAutowire { }

Issue: SPR-9890