MethodValidator that
uses Bean Validation to validate @RequestMapping method arguments.
Handles validation results by populating BindingResult method
arguments with errors from beanResults. Also, helps to determine parameter names for
@ModelAttribute and @RequestBody parameters.
| Modifier and Type | Class and Description |
|---|---|
| private static class | HandlerMethodValidator.
ObjectNameResolver for web controller methods. |
| Modifier and Type | Field and Description |
|---|---|
| private final Predicate | |
| private static final MethodValidationAdapter. | |
| private final Predicate | |
| private final MethodValidationAdapter |
| Access | Constructor and Description |
|---|---|
| private | HandlerMethodValidator(MethodValidationAdapter validationAdapter, Predicate<MethodParameter> modelAttributePredicate, Predicate<MethodParameter> requestParamPredicate)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | applyArgumentValidation(Object target, Method method, MethodParameter[] parameters, Object[] arguments, Class<?>[] groups)
Overrides default org. Delegate to |
| public void | applyReturnValueValidation(Object target, Method method, MethodParameter returnType, Object returnValue, Class<?>[] groups)
Overrides default org. Delegate to |
| public Class | determineValidationGroups(Object
the target Object target, Method the target method method)Implements org. Determine the applicable validation groups. |
| public static MethodValidator | from(WebBindingInitializer initializer, ParameterNameDiscoverer paramNameDiscoverer, Predicate<MethodParameter> modelAttributePredicate, Predicate<MethodParameter> requestParamPredicate)
Static factory method to create a |
| private static Validator | |
| public MethodValidationResult | validateArguments(Object
the target Object target, Method the target method method, MethodParameter[] the parameters, if already created and available parameters, Object[] the candidate argument values to validate arguments, Class<?>[] validation groups from groups)determineValidationGroupsImplements org. Validate the given method arguments and return validation results. |
| public MethodValidationResult | validateReturnValue(Object
the target Object target, Method the target method method, MethodParameter the return parameter, if already created and available returnType, Object the return value to validate returnValue, Class<?>[] validation groups from groups)determineValidationGroupsImplements org. Validate the given return value and return validation results. |
| modelAttributePredicate | back to summary |
|---|---|
| private final Predicate<MethodParameter> modelAttributePredicate | |
| objectNameResolver | back to summary |
|---|---|
| private static final MethodValidationAdapter. | |
| requestParamPredicate | back to summary |
|---|---|
| private final Predicate<MethodParameter> requestParamPredicate | |
| validationAdapter | back to summary |
|---|---|
| private final MethodValidationAdapter validationAdapter | |
| HandlerMethodValidator | back to summary |
|---|---|
| private HandlerMethodValidator(MethodValidationAdapter validationAdapter, Predicate<MethodParameter> modelAttributePredicate, Predicate<MethodParameter> requestParamPredicate) | |
| applyArgumentValidation | back to summary |
|---|---|
| public void applyArgumentValidation(Object target, Method method, MethodParameter[] parameters, Object[] arguments, Class<?>[] groups) Overrides default org. Doc from org. Delegate to
| |
| applyReturnValueValidation | back to summary |
|---|---|
| public void applyReturnValueValidation(Object target, Method method, MethodParameter returnType, Object returnValue, Class<?>[] groups) Overrides default org. Doc from org. Delegate to
| |
| determineValidationGroups | back to summary |
|---|---|
| public Class Implements org. Doc from org. Determine the applicable validation groups. By default, obtained from an
| |
| from | back to summary |
|---|---|
| public static MethodValidator from(WebBindingInitializer initializer, ParameterNameDiscoverer paramNameDiscoverer, Predicate<MethodParameter> modelAttributePredicate, Predicate<MethodParameter> requestParamPredicate) Static factory method to create a
| |
| getValidator | back to summary |
|---|---|
private static Validator getValidator(ConfigurableWebBindingInitializer initializer)
| |
| validateArguments | back to summary |
|---|---|
| public MethodValidationResult validateArguments(Object target, Method method, MethodParameter[] parameters, Object[] arguments, Class<?>[] groups) Implements org. Doc from org. Validate the given method arguments and return validation results.
| |
| validateReturnValue | back to summary |
|---|---|
| public MethodValidationResult validateReturnValue(Object target, Method method, MethodParameter returnType, Object returnValue, Class<?>[] groups) Implements org. Doc from org. Validate the given return value and return validation results.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | resolveName(MethodParameter
the method parameter param, Object the argument value or return value value)Implements org. Determine the name for the given method argument. |
| WebObjectNameResolver | back to summary |
|---|---|
| private WebObjectNameResolver() | |
| resolveName | back to summary |
|---|---|
| public String resolveName(MethodParameter param, Object value) Implements org. Doc from org. Determine the name for the given method argument.
| |