|
|
@ -153,7 +153,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new {@code AutowiredAnnotationBeanPostProcessor} for Spring's |
|
|
|
* Create a new {@code AutowiredAnnotationBeanPostProcessor} for Spring's |
|
|
|
* standard {@link Autowired @Autowired} annotation. |
|
|
|
* standard {@link Autowired @Autowired} and {@link Value @Value} annotations. |
|
|
|
* <p>Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation, |
|
|
|
* <p>Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation, |
|
|
|
* if available. |
|
|
|
* if available. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -174,9 +174,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the 'autowired' annotation type, to be used on constructors, fields, |
|
|
|
* Set the 'autowired' annotation type, to be used on constructors, fields, |
|
|
|
* setter methods and arbitrary config methods. |
|
|
|
* setter methods, and arbitrary config methods. |
|
|
|
* <p>The default autowired annotation type is the Spring-provided {@link Autowired} |
|
|
|
* <p>The default autowired annotation types are the Spring-provided |
|
|
|
* annotation, as well as {@link Value}. |
|
|
|
* {@link Autowired @Autowired} and {@link Value @Value} annotations as well |
|
|
|
|
|
|
|
* as JSR-330's {@link javax.inject.Inject @Inject} annotation, if available. |
|
|
|
* <p>This setter property exists so that developers can provide their own |
|
|
|
* <p>This setter property exists so that developers can provide their own |
|
|
|
* (non-Spring-specific) annotation type to indicate that a member is supposed |
|
|
|
* (non-Spring-specific) annotation type to indicate that a member is supposed |
|
|
|
* to be autowired. |
|
|
|
* to be autowired. |
|
|
@ -189,9 +190,10 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the 'autowired' annotation types, to be used on constructors, fields, |
|
|
|
* Set the 'autowired' annotation types, to be used on constructors, fields, |
|
|
|
* setter methods and arbitrary config methods. |
|
|
|
* setter methods, and arbitrary config methods. |
|
|
|
* <p>The default autowired annotation type is the Spring-provided {@link Autowired} |
|
|
|
* <p>The default autowired annotation types are the Spring-provided |
|
|
|
* annotation, as well as {@link Value}. |
|
|
|
* {@link Autowired @Autowired} and {@link Value @Value} annotations as well |
|
|
|
|
|
|
|
* as JSR-330's {@link javax.inject.Inject @Inject} annotation, if available. |
|
|
|
* <p>This setter property exists so that developers can provide their own |
|
|
|
* <p>This setter property exists so that developers can provide their own |
|
|
|
* (non-Spring-specific) annotation types to indicate that a member is supposed |
|
|
|
* (non-Spring-specific) annotation types to indicate that a member is supposed |
|
|
|
* to be autowired. |
|
|
|
* to be autowired. |
|
|
@ -203,7 +205,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the name of a parameter of the annotation that specifies whether it is required. |
|
|
|
* Set the name of an attribute of the annotation that specifies whether it is required. |
|
|
|
* @see #setRequiredParameterValue(boolean) |
|
|
|
* @see #setRequiredParameterValue(boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setRequiredParameterName(String requiredParameterName) { |
|
|
|
public void setRequiredParameterName(String requiredParameterName) { |
|
|
@ -211,7 +213,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the boolean value that marks a dependency as required |
|
|
|
* Set the boolean value that marks a dependency as required. |
|
|
|
* <p>For example if using 'required=true' (the default), this value should be |
|
|
|
* <p>For example if using 'required=true' (the default), this value should be |
|
|
|
* {@code true}; but if using 'optional=false', this value should be {@code false}. |
|
|
|
* {@code true}; but if using 'optional=false', this value should be {@code false}. |
|
|
|
* @see #setRequiredParameterName(String) |
|
|
|
* @see #setRequiredParameterName(String) |
|
|
@ -415,9 +417,11 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 'Native' processing method for direct calls with an arbitrary target instance, |
|
|
|
* 'Native' processing method for direct calls with an arbitrary target instance, |
|
|
|
* resolving all of its fields and methods which are annotated with {@code @Autowired}. |
|
|
|
* resolving all of its fields and methods which are annotated with one of the |
|
|
|
|
|
|
|
* configured 'autowired' annotation types. |
|
|
|
* @param bean the target instance to process |
|
|
|
* @param bean the target instance to process |
|
|
|
* @throws BeanCreationException if autowiring failed |
|
|
|
* @throws BeanCreationException if autowiring failed |
|
|
|
|
|
|
|
* @see #setAutowiredAnnotationTypes(Set) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void processInjection(Object bean) throws BeanCreationException { |
|
|
|
public void processInjection(Object bean) throws BeanCreationException { |
|
|
|
Class<?> clazz = bean.getClass(); |
|
|
|
Class<?> clazz = bean.getClass(); |
|
|
|