类 CustomRequestParamMethodArgumentResolver
- java.lang.Object
-
- org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
-
- ai.yue.library.web.config.argument.resolver.CustomRequestParamMethodArgumentResolver
-
- 所有已实现的接口:
org.springframework.web.method.support.HandlerMethodArgumentResolver,org.springframework.web.method.support.UriComponentsContributor
public class CustomRequestParamMethodArgumentResolver extends org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver implements org.springframework.web.method.support.UriComponentsContributorRequestParamMethodArgumentResolver 增强添加对body参数的解析
- 从以下版本开始:
- 2020年7月25日
- 作者:
- ylyue
-
-
构造器概要
构造器 构造器 说明 CustomRequestParamMethodArgumentResolver(boolean useDefaultResolution)Create a newCustomRequestParamMethodArgumentResolverinstance.CustomRequestParamMethodArgumentResolver(org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory, boolean useDefaultResolution)Create a newCustomRequestParamMethodArgumentResolverinstance.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcontributeMethodArgument(org.springframework.core.MethodParameter parameter, java.lang.Object value, org.springframework.web.util.UriComponentsBuilder builder, java.util.Map<java.lang.String,java.lang.Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)protected org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfocreateNamedValueInfo(org.springframework.core.MethodParameter parameter)protected java.lang.StringformatUriValue(org.springframework.core.convert.ConversionService cs, org.springframework.core.convert.TypeDescriptor sourceType, java.lang.Object value)protected voidhandleMissingValue(java.lang.String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request)protected java.lang.ObjectresolveName(java.lang.String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request)booleansupportsParameter(org.springframework.core.MethodParameter parameter)Supports the following: @RequestParam-annotated method arguments.
-
-
-
构造器详细资料
-
CustomRequestParamMethodArgumentResolver
public CustomRequestParamMethodArgumentResolver(boolean useDefaultResolution)
Create a newCustomRequestParamMethodArgumentResolverinstance.- 参数:
useDefaultResolution- in default resolution mode a method argument that is a simple type, as defined inBeanUtils.isSimpleProperty(java.lang.Class<?>), is treated as a request parameter even if it isn't annotated, the request parameter name is derived from the method parameter name.
-
CustomRequestParamMethodArgumentResolver
public CustomRequestParamMethodArgumentResolver(@Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory, boolean useDefaultResolution)Create a newCustomRequestParamMethodArgumentResolverinstance.- 参数:
beanFactory- a bean factory used for resolving ${...} placeholder and #{...} SpEL expressions in default values, ornullif default values are not expected to contain expressionsuseDefaultResolution- in default resolution mode a method argument that is a simple type, as defined inBeanUtils.isSimpleProperty(java.lang.Class<?>), is treated as a request parameter even if it isn't annotated, the request parameter name is derived from the method parameter name.
-
-
方法详细资料
-
supportsParameter
public boolean supportsParameter(org.springframework.core.MethodParameter parameter)
Supports the following:- @RequestParam-annotated method arguments.
This excludes
Mapparams where the annotation does not specify a name. SeeRequestParamMapMethodArgumentResolverinstead for such params. - Arguments of type
MultipartFileunless annotated with @RequestPart. - Arguments of type
Partunless annotated with @RequestPart. - In default resolution mode, simple type arguments even if not with @
RequestParam.
- 指定者:
supportsParameter在接口中org.springframework.web.method.support.HandlerMethodArgumentResolver- 指定者:
supportsParameter在接口中org.springframework.web.method.support.UriComponentsContributor
- @RequestParam-annotated method arguments.
This excludes
-
createNamedValueInfo
protected org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(org.springframework.core.MethodParameter parameter)
- 指定者:
createNamedValueInfo在类中org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
-
resolveName
@Nullable protected java.lang.Object resolveName(java.lang.String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.Exception- 指定者:
resolveName在类中org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver- 抛出:
java.lang.Exception
-
handleMissingValue
protected void handleMissingValue(java.lang.String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.Exception- 覆盖:
handleMissingValue在类中org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver- 抛出:
java.lang.Exception
-
contributeMethodArgument
public void contributeMethodArgument(org.springframework.core.MethodParameter parameter, @Nullable java.lang.Object value, org.springframework.web.util.UriComponentsBuilder builder, java.util.Map<java.lang.String,java.lang.Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)- 指定者:
contributeMethodArgument在接口中org.springframework.web.method.support.UriComponentsContributor
-
formatUriValue
@Nullable protected java.lang.String formatUriValue(@Nullable org.springframework.core.convert.ConversionService cs, @Nullable org.springframework.core.convert.TypeDescriptor sourceType, @Nullable java.lang.Object value)
-
-