001/* 002 * Copyright 2002-2017 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.springframework.web.reactive.result.method.annotation; 017 018import java.util.ArrayList; 019import java.util.Arrays; 020import java.util.List; 021 022import org.springframework.util.Assert; 023import org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver; 024 025/** 026 * Helps to configure resolvers for Controller method arguments. 027 * 028 * @author Rossen Stoyanchev 029 * @since 5.0 030 */ 031public class ArgumentResolverConfigurer { 032 033 private final List<HandlerMethodArgumentResolver> customResolvers = new ArrayList<>(8); 034 035 036 /** 037 * Configure resolvers for custom controller method arguments. 038 * @param resolver the resolver(s) to add 039 */ 040 public void addCustomResolver(HandlerMethodArgumentResolver... resolver) { 041 Assert.notNull(resolver, "'resolvers' must not be null"); 042 this.customResolvers.addAll(Arrays.asList(resolver)); 043 } 044 045 046 List<HandlerMethodArgumentResolver> getCustomResolvers() { 047 return this.customResolvers; 048 } 049 050}