Move HandlerMethodValidator to web.method.annotation package

Avoiding cycle between web.method.support and web.method.annotation packages.

See gh-29825
This commit is contained in:
Juergen Hoeller
2023-06-14 21:52:55 +02:00
parent e344f3f869
commit 220995b830
3 changed files with 4 additions and 6 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.support;
package org.springframework.web.method.annotation;
import java.lang.reflect.Method;
@@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.method.annotation.ModelFactory;
/**
* {@link org.springframework.validation.beanvalidation.MethodValidator} for
@@ -48,7 +47,6 @@ import org.springframework.web.method.annotation.ModelFactory;
*/
public final class HandlerMethodValidator extends DefaultMethodValidator {
private HandlerMethodValidator(MethodValidationAdapter adapter) {
super(adapter);
}
@@ -86,7 +84,7 @@ public final class HandlerMethodValidator extends DefaultMethodValidator {
return Conventions.getVariableNameForParameter(param);
}
else {
return ((param.getParameterIndex() != -1) ?
return (param.getParameterIndex() != -1 ?
ModelFactory.getNameForParameter(param) :
ModelFactory.getNameForReturnValue(argument, param));
}

View File

@@ -38,7 +38,7 @@ import org.springframework.util.CollectionUtils;
import org.springframework.validation.beanvalidation.MethodValidator;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.support.HandlerMethodValidator;
import org.springframework.web.method.annotation.HandlerMethodValidator;
import org.springframework.web.reactive.BindingContext;
import org.springframework.web.reactive.DispatchExceptionHandler;
import org.springframework.web.reactive.HandlerAdapter;

View File

@@ -74,6 +74,7 @@ import org.springframework.web.method.ControllerAdviceBean;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.method.annotation.ErrorsMethodArgumentResolver;
import org.springframework.web.method.annotation.ExpressionValueMethodArgumentResolver;
import org.springframework.web.method.annotation.HandlerMethodValidator;
import org.springframework.web.method.annotation.InitBinderDataBinderFactory;
import org.springframework.web.method.annotation.MapMethodProcessor;
import org.springframework.web.method.annotation.ModelFactory;
@@ -88,7 +89,6 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolverComposite;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite;
import org.springframework.web.method.support.HandlerMethodValidator;
import org.springframework.web.method.support.InvocableHandlerMethod;
import org.springframework.web.method.support.ModelAndViewContainer;
import org.springframework.web.servlet.ModelAndView;