Browse Source

Remove no longer supported protected methods

Closes gh-26721
pull/30772/head
rstoyanchev 3 years ago
parent
commit
91eb2be44c
  1. 49
      spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java
  2. 10
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java

49
spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java

@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.web.method.annotation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.util.Map;
import java.util.Optional;
@ -188,33 +187,16 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol @@ -188,33 +187,16 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol
* @param attributeName the name of the attribute (never {@code null})
* @param parameter the method parameter declaration
* @param binderFactory for creating WebDataBinder instance
* @param webRequest the current request
* @return the created model attribute (never {@code null})
* @throws BindException in case of constructor argument binding failure
* @throws Exception in case of constructor instantiation failure
* @see #constructAttribute(Constructor, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
* @see BeanUtils#findPrimaryConstructor(Class)
* @param request the current request
* @return the created model attribute, or {@code null}
*/
@Nullable
protected Object createAttribute(String attributeName, MethodParameter parameter,
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {
WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception {
return null;
}
/**
* Construct a new attribute instance with the given constructor.
* @since 5.1
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
protected Object constructAttribute(Constructor<?> ctor, String attributeName, MethodParameter parameter,
WebDataBinderFactory binderFactory, NativeWebRequest webRequest) throws Exception {
throw new UnsupportedOperationException();
}
/**
* Extension point to create the attribute, binding the request to constructor args.
* @param binder the data binder instance to use for the binding
@ -234,18 +216,6 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol @@ -234,18 +216,6 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol
((WebRequestDataBinder) binder).bind(request);
}
/**
* Resolve the value for a constructor argument.
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
public Object resolveConstructorArgument(String paramName, Class<?> paramType, NativeWebRequest request)
throws Exception {
throw new UnsupportedOperationException();
}
/**
* Validate the model attribute if applicable.
* <p>The default implementation checks for {@code @jakarta.validation.Valid},
@ -266,19 +236,6 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol @@ -266,19 +236,6 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol
}
}
/**
* Validate the specified candidate value if applicable.
* @since 5.1
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
protected void validateValueIfApplicable(WebDataBinder binder, MethodParameter parameter,
Class<?> targetType, String fieldName, @Nullable Object value) {
throw new UnsupportedOperationException();
}
/**
* Whether to raise a fatal bind exception on validation errors.
* <p>The default implementation delegates to {@link #isBindExceptionRequired(MethodParameter)}.

10
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ModelAttributeMethodArgumentResolver.java

@ -181,16 +181,6 @@ public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentR @@ -181,16 +181,6 @@ public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentR
return null;
}
/**
* Protected method to obtain the values for data binding.
* @deprecated and not called; replaced by built-in support for
* constructor initialization in {@link org.springframework.validation.DataBinder}
*/
@Deprecated(since = "6.1", forRemoval = true)
public Mono<Map<String, Object>> getValuesToBind(WebExchangeDataBinder binder, ServerWebExchange exchange) {
throw new UnsupportedOperationException();
}
/**
* Extension point to create the attribute, binding the request to constructor args.
* @param binder the data binder instance to use for the binding

Loading…
Cancel
Save