类 ArrayArgumentResolver

  • 所有已实现的接口:
    org.springframework.web.method.support.HandlerMethodArgumentResolver, org.springframework.web.method.support.UriComponentsContributor

    public class ArrayArgumentResolver
    extends org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
    implements org.springframework.web.method.support.UriComponentsContributor
    Array、List对象方法参数解析器
    从以下版本开始:
    2020年6月9日
    作者:
    ylyue
    • 嵌套类概要

      • 从类继承的嵌套类/接口 org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver

        org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void contributeMethodArgument​(org.springframework.core.MethodParameter parameter, Object value, org.springframework.web.util.UriComponentsBuilder builder, Map<String,​Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)  
      protected org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo​(org.springframework.core.MethodParameter parameter)  
      protected String formatUriValue​(org.springframework.core.convert.ConversionService cs, org.springframework.core.convert.TypeDescriptor sourceType, Object value)  
      protected void handleMissingValue​(String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request)  
      protected Object resolveName​(String name, org.springframework.core.MethodParameter parameter, org.springframework.web.context.request.NativeWebRequest request)  
      boolean supportsParameter​(org.springframework.core.MethodParameter parameter)
      Supports the following: @RequestParam-annotated method arguments.
      • 从类继承的方法 org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver

        handleMissingValue, handleResolvedValue, resolveArgument
    • 构造器详细资料

      • ArrayArgumentResolver

        public ArrayArgumentResolver​(boolean useDefaultResolution)
        参数:
        useDefaultResolution - in default resolution mode a method argument that is a simple type, as defined in BeanUtils.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.
      • ArrayArgumentResolver

        public ArrayArgumentResolver​(@Nullable
                                     org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory,
                                     boolean useDefaultResolution)
        参数:
        beanFactory - a bean factory used for resolving ${...} placeholder and #{...} SpEL expressions in default values, or null if default values are not expected to contain expressions
        useDefaultResolution - in default resolution mode a method argument that is a simple type, as defined in BeanUtils.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 Map params where the annotation does not specify a name. See RequestParamMapMethodArgumentResolver instead for such params.
        • Arguments of type MultipartFile unless annotated with @RequestPart.
        • Arguments of type Part unless 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
      • 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 Object resolveName​(String name,
                                     org.springframework.core.MethodParameter parameter,
                                     org.springframework.web.context.request.NativeWebRequest request)
                              throws Exception
        指定者:
        resolveName 在类中 org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
        抛出:
        Exception
      • handleMissingValue

        protected void handleMissingValue​(String name,
                                          org.springframework.core.MethodParameter parameter,
                                          org.springframework.web.context.request.NativeWebRequest request)
                                   throws Exception
        覆盖:
        handleMissingValue 在类中 org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
        抛出:
        Exception
      • contributeMethodArgument

        public void contributeMethodArgument​(org.springframework.core.MethodParameter parameter,
                                             @Nullable
                                             Object value,
                                             org.springframework.web.util.UriComponentsBuilder builder,
                                             Map<String,​Object> uriVariables,
                                             org.springframework.core.convert.ConversionService conversionService)
        指定者:
        contributeMethodArgument 在接口中 org.springframework.web.method.support.UriComponentsContributor
      • formatUriValue

        @Nullable
        protected String formatUriValue​(@Nullable
                                        org.springframework.core.convert.ConversionService cs,
                                        @Nullable
                                        org.springframework.core.convert.TypeDescriptor sourceType,
                                        @Nullable
                                        Object value)