Skip to content

Commit d64dd19

Browse files
committed
consistent specification of standard meta-annotations
1 parent bffa50e commit d64dd19

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/Autowired.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.beans.factory.annotation;
1818

19+
import java.lang.annotation.Documented;
1920
import java.lang.annotation.ElementType;
2021
import java.lang.annotation.Retention;
2122
import java.lang.annotation.RetentionPolicy;
@@ -46,16 +47,25 @@
4647
* declared value type. In case of a Map, the keys must be declared as
4748
* type String and will be resolved to the corresponding bean names.
4849
*
49-
* <p>Please do consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
50+
* <p>Note that actual injection is performed through a
51+
* {@link org.springframework.beans.factory.config.BeanPostProcessor
52+
* BeanPostProcessor} which in turn means that you <em>cannot</em>
53+
* use {@code @Autowired} to inject references into
54+
* {@link org.springframework.beans.factory.config.BeanPostProcessor
55+
* BeanPostProcessor} or {@link BeanFactoryPostProcessor} types. Please
56+
* consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
5057
* class (which, by default, checks for the presence of this annotation).
5158
*
5259
* @author Juergen Hoeller
5360
* @author Mark Fisher
5461
* @since 2.5
5562
* @see AutowiredAnnotationBeanPostProcessor
63+
* @see Qualifier
64+
* @see Value
5665
*/
57-
@Retention(RetentionPolicy.RUNTIME)
5866
@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD})
67+
@Retention(RetentionPolicy.RUNTIME)
68+
@Documented
5969
public @interface Autowired {
6070

6171
/**

org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,10 +34,10 @@
3434
* @author Ramnivas Laddad
3535
* @since 2.0
3636
*/
37-
@Retention(RetentionPolicy.RUNTIME)
3837
@Target(ElementType.TYPE)
39-
@Documented
38+
@Retention(RetentionPolicy.RUNTIME)
4039
@Inherited
40+
@Documented
4141
public @interface Configurable {
4242

4343
/**

org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/Qualifier.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2008 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,9 +31,10 @@
3131
* @author Mark Fisher
3232
* @author Juergen Hoeller
3333
* @since 2.5
34+
* @see Autowired
3435
*/
35-
@Retention(RetentionPolicy.RUNTIME)
3636
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE, ElementType.ANNOTATION_TYPE})
37+
@Retention(RetentionPolicy.RUNTIME)
3738
@Inherited
3839
@Documented
3940
public @interface Qualifier {

org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/Value.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2011 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.beans.factory.annotation;
1818

19+
import java.lang.annotation.Documented;
1920
import java.lang.annotation.ElementType;
2021
import java.lang.annotation.Retention;
2122
import java.lang.annotation.RetentionPolicy;
@@ -31,13 +32,25 @@
3132
* <p>A common use case is to assign default field values using
3233
* "#{systemProperties.myProp}" style expressions.
3334
*
35+
* <p>Note that actual processing of the {@code @Value} annotation is performed
36+
* by a {@link org.springframework.beans.factory.config.BeanPostProcessor
37+
* BeanPostProcessor} which in turn means that you <em>cannot</em> use
38+
* {@code @Value} within
39+
* {@link org.springframework.beans.factory.config.BeanPostProcessor
40+
* BeanPostProcessor} or {@link BeanFactoryPostProcessor} types. Please
41+
* consult the javadoc for the {@link AutowiredAnnotationBeanPostProcessor}
42+
* class (which, by default, checks for the presence of this annotation).
43+
*
3444
* @author Juergen Hoeller
3545
* @since 3.0
46+
* @see AutowiredAnnotationBeanPostProcessor
47+
* @see Autowired
3648
* @see org.springframework.beans.factory.config.BeanExpressionResolver
3749
* @see org.springframework.beans.factory.support.AutowireCandidateResolver#getSuggestedValue
3850
*/
39-
@Retention(RetentionPolicy.RUNTIME)
4051
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
52+
@Retention(RetentionPolicy.RUNTIME)
53+
@Documented
4154
public @interface Value {
4255

4356
/**

0 commit comments

Comments
 (0)