74
74
* <p>Also supports JSR-330's {@link javax.inject.Inject @Inject} annotation,
75
75
* if available, as a direct alternative to Spring's own {@code @Autowired}.
76
76
*
77
- * <p>Only one constructor (at max) of any given bean class may carry this
78
- * annotation with the 'required' parameter set to {@code true},
79
- * indicating <i>the</i> constructor to autowire when used as a Spring bean.
80
- * If multiple <i>non-required</i> constructors carry the annotation, they
81
- * will be considered as candidates for autowiring. The constructor with
82
- * the greatest number of dependencies that can be satisfied by matching
83
- * beans in the Spring container will be chosen. If none of the candidates
84
- * can be satisfied, then a default constructor (if present) will be used.
85
- * An annotated constructor does not have to be public.
77
+ * <p>Only one constructor (at max) of any given bean class may declare this annotation
78
+ * with the 'required' parameter set to {@code true}, indicating <i>the</i> constructor
79
+ * to autowire when used as a Spring bean. If multiple <i>non-required</i> constructors
80
+ * declare the annotation, they will be considered as candidates for autowiring.
81
+ * The constructor with the greatest number of dependencies that can be satisfied by
82
+ * matching beans in the Spring container will be chosen. If none of the candidates
83
+ * can be satisfied, then a primary/default constructor (if present) will be used.
84
+ * If a class only declares a single constructor to begin with, it will always be used,
85
+ * even if not annotated. An annotated constructor does not have to be public.
86
86
*
87
87
* <p>Fields are injected right after construction of a bean, before any
88
88
* config methods are invoked. Such a config field does not have to be public.
@@ -161,11 +161,11 @@ public AutowiredAnnotationBeanPostProcessor() {
161
161
/**
162
162
* Set the 'autowired' annotation type, to be used on constructors, fields,
163
163
* setter methods and arbitrary config methods.
164
- * <p>The default autowired annotation type is the Spring-provided
165
- * {@link Autowired} annotation, as well as {@link Value}.
164
+ * <p>The default autowired annotation type is the Spring-provided {@link Autowired}
165
+ * annotation, as well as {@link Value}.
166
166
* <p>This setter property exists so that developers can provide their own
167
- * (non-Spring-specific) annotation type to indicate that a member is
168
- * supposed to be autowired.
167
+ * (non-Spring-specific) annotation type to indicate that a member is supposed
168
+ * to be autowired.
169
169
*/
170
170
public void setAutowiredAnnotationType (Class <? extends Annotation > autowiredAnnotationType ) {
171
171
Assert .notNull (autowiredAnnotationType , "'autowiredAnnotationType' must not be null" );
@@ -176,11 +176,11 @@ public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnno
176
176
/**
177
177
* Set the 'autowired' annotation types, to be used on constructors, fields,
178
178
* setter methods and arbitrary config methods.
179
- * <p>The default autowired annotation type is the Spring-provided
180
- * {@link Autowired} annotation, as well as {@link Value}.
179
+ * <p>The default autowired annotation type is the Spring-provided {@link Autowired}
180
+ * annotation, as well as {@link Value}.
181
181
* <p>This setter property exists so that developers can provide their own
182
- * (non-Spring-specific) annotation types to indicate that a member is
183
- * supposed to be autowired.
182
+ * (non-Spring-specific) annotation types to indicate that a member is supposed
183
+ * to be autowired.
184
184
*/
185
185
public void setAutowiredAnnotationTypes (Set <Class <? extends Annotation >> autowiredAnnotationTypes ) {
186
186
Assert .notEmpty (autowiredAnnotationTypes , "'autowiredAnnotationTypes' must not be empty" );
@@ -189,8 +189,7 @@ public void setAutowiredAnnotationTypes(Set<Class<? extends Annotation>> autowir
189
189
}
190
190
191
191
/**
192
- * Set the name of a parameter of the annotation that specifies
193
- * whether it is required.
192
+ * Set the name of a parameter of the annotation that specifies whether it is required.
194
193
* @see #setRequiredParameterValue(boolean)
195
194
*/
196
195
public void setRequiredParameterName (String requiredParameterName ) {
@@ -199,9 +198,8 @@ public void setRequiredParameterName(String requiredParameterName) {
199
198
200
199
/**
201
200
* Set the boolean value that marks a dependency as required
202
- * <p>For example if using 'required=true' (the default),
203
- * this value should be {@code true}; but if using
204
- * 'optional=false', this value should be {@code false}.
201
+ * <p>For example if using 'required=true' (the default), this value should be
202
+ * {@code true}; but if using 'optional=false', this value should be {@code false}.
205
203
* @see #setRequiredParameterName(String)
206
204
*/
207
205
public void setRequiredParameterValue (boolean requiredParameterValue ) {
0 commit comments