17
17
package org .springframework .web .method .annotation ;
18
18
19
19
import java .lang .annotation .Annotation ;
20
- import java .lang .reflect .Constructor ;
21
20
import java .util .Map ;
22
21
import java .util .Optional ;
23
22
@@ -188,33 +187,16 @@ private static Object wrapAsOptionalIfNecessary(MethodParameter parameter, @Null
188
187
* @param attributeName the name of the attribute (never {@code null})
189
188
* @param parameter the method parameter declaration
190
189
* @param binderFactory for creating WebDataBinder instance
191
- * @param webRequest the current request
192
- * @return the created model attribute (never {@code null})
193
- * @throws BindException in case of constructor argument binding failure
194
- * @throws Exception in case of constructor instantiation failure
195
- * @see #constructAttribute(Constructor, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
196
- * @see BeanUtils#findPrimaryConstructor(Class)
190
+ * @param request the current request
191
+ * @return the created model attribute, or {@code null}
197
192
*/
198
193
@ Nullable
199
194
protected Object createAttribute (String attributeName , MethodParameter parameter ,
200
- WebDataBinderFactory binderFactory , NativeWebRequest webRequest ) throws Exception {
195
+ WebDataBinderFactory binderFactory , NativeWebRequest request ) throws Exception {
201
196
202
197
return null ;
203
198
}
204
199
205
- /**
206
- * Construct a new attribute instance with the given constructor.
207
- * @since 5.1
208
- * @deprecated and not called; replaced by built-in support for
209
- * constructor initialization in {@link org.springframework.validation.DataBinder}
210
- */
211
- @ Deprecated (since = "6.1" , forRemoval = true )
212
- protected Object constructAttribute (Constructor <?> ctor , String attributeName , MethodParameter parameter ,
213
- WebDataBinderFactory binderFactory , NativeWebRequest webRequest ) throws Exception {
214
-
215
- throw new UnsupportedOperationException ();
216
- }
217
-
218
200
/**
219
201
* Extension point to create the attribute, binding the request to constructor args.
220
202
* @param binder the data binder instance to use for the binding
@@ -234,18 +216,6 @@ protected void bindRequestParameters(WebDataBinder binder, NativeWebRequest requ
234
216
((WebRequestDataBinder ) binder ).bind (request );
235
217
}
236
218
237
- /**
238
- * Resolve the value for a constructor argument.
239
- * @deprecated and not called; replaced by built-in support for
240
- * constructor initialization in {@link org.springframework.validation.DataBinder}
241
- */
242
- @ Deprecated (since = "6.1" , forRemoval = true )
243
- public Object resolveConstructorArgument (String paramName , Class <?> paramType , NativeWebRequest request )
244
- throws Exception {
245
-
246
- throw new UnsupportedOperationException ();
247
- }
248
-
249
219
/**
250
220
* Validate the model attribute if applicable.
251
221
* <p>The default implementation checks for {@code @jakarta.validation.Valid},
@@ -266,19 +236,6 @@ protected void validateIfApplicable(WebDataBinder binder, MethodParameter parame
266
236
}
267
237
}
268
238
269
- /**
270
- * Validate the specified candidate value if applicable.
271
- * @since 5.1
272
- * @deprecated and not called; replaced by built-in support for
273
- * constructor initialization in {@link org.springframework.validation.DataBinder}
274
- */
275
- @ Deprecated (since = "6.1" , forRemoval = true )
276
- protected void validateValueIfApplicable (WebDataBinder binder , MethodParameter parameter ,
277
- Class <?> targetType , String fieldName , @ Nullable Object value ) {
278
-
279
- throw new UnsupportedOperationException ();
280
- }
281
-
282
239
/**
283
240
* Whether to raise a fatal bind exception on validation errors.
284
241
* <p>The default implementation delegates to {@link #isBindExceptionRequired(MethodParameter)}.
0 commit comments