diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java index 9a759cf08d..fdc50b0335 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java @@ -62,8 +62,11 @@ import org.springframework.util.ReflectionUtils; /** * {@link org.springframework.beans.factory.config.BeanPostProcessor} implementation * that autowires annotated fields, setter methods and arbitrary config methods. - * Such members to be injected are detected through a Java 5 annotation: - * by default, Spring's @{@link Autowired} and @{@link Value} annotations. + * Such members to be injected are detected through a Java 5 annotation: by default, + * Spring's {@link Autowired @Autowired} and {@link Value @Value} annotations. + * + *
Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation,
+ * if available, as a direct alternative to Spring's own @Autowired
.
*
*
Only one constructor (at max) of any given bean class may carry this
* annotation with the 'required' parameter set to true
,
@@ -78,14 +81,10 @@ import org.springframework.util.ReflectionUtils;
*
Fields are injected right after construction of a bean, before any * config methods are invoked. Such a config field does not have to be public. * - *
Config methods may have an arbitrary name and any number of arguments; - * each of those arguments will be autowired with a matching bean in the - * Spring container. Bean property setter methods are effectively just - * a special case of such a general config method. Such config methods - * do not have to be public. - * - *
Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation, if - * available. + *
Config methods may have an arbitrary name and any number of arguments; each of + * those arguments will be autowired with a matching bean in the Spring container. + * Bean property setter methods are effectively just a special case of such a + * general config method. Config methods do not have to be public. * *
Note: A default AutowiredAnnotationBeanPostProcessor will be registered * by the "context:annotation-config" and "context:component-scan" XML tags. @@ -372,7 +371,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean private Annotation findAutowiredAnnotation(AccessibleObject ao) { for (Class extends Annotation> type : this.autowiredAnnotationTypes) { if (ao instanceof Method) { - ao = BridgeMethodResolver.findBridgedMethod((Method)ao); + ao = BridgeMethodResolver.findBridgedMethod((Method) ao); } Annotation annotation = ao.getAnnotation(type); if (annotation != null) { diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java index 55668bedd7..8478cf6f2f 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java @@ -35,7 +35,6 @@ import java.util.LinkedList; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; - import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; @@ -96,12 +95,12 @@ import org.springframework.util.StringUtils; * specify both a local bean name and a global JNDI name for fallback retrieval. * The target beans can be plain POJOs as well as EJB 3 Session Beans in this case. * - *
The common annotations supported by this post-processor are available - * in Java 6 (JDK 1.6) as well as in Java EE 5 (which provides a standalone jar for + *
The common annotations supported by this post-processor are available in + * Java 6 (JDK 1.6) as well as in Java EE 5/6 (which provides a standalone jar for * its common annotations as well, allowing for use in any Java 5 based application). * Hence, this post-processor works out of the box on JDK 1.6, and requires the * JSR-250 API jar (and optionally the JAX-WS API jar and/or the EJB 3 API jar) - * to be added to the classpath on JDK 1.5 (when running outside of Java EE 5). + * to be added to the classpath on JDK 1.5 (when running outside of Java EE 5/6). * *
For default usage, resolving resource names as Spring bean names, * simply define the following in your application context: