类 ParameterResolvingStrategies
java.lang.Object
cn.taketoday.web.bind.resolver.ParameterResolvingStrategies
- 所有已实现的接口:
cn.taketoday.core.ArraySizeTrimmer,ParameterResolvingStrategy,Iterable<ParameterResolvingStrategy>
public class ParameterResolvingStrategies
extends Object
implements cn.taketoday.core.ArraySizeTrimmer, Iterable<ParameterResolvingStrategy>, ParameterResolvingStrategy
Composite ParameterResolvingStrategy
- 从以下版本开始:
- 4.0
- 作者:
- TODAY 2021/9/26 21:07
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidadd(ParameterResolvingStrategy resolver) voidadd(ParameterResolvingStrategy... resolver) add resolvers or resolving-strategiesvoidadd(List<ParameterResolvingStrategy> resolvers) add resolvers or resolving-strategiesbooleanReturns true if resolvers list contains the specifiedresolverClass.voidforEach(Consumer<? super ParameterResolvingStrategy> action) Returns the instance of the first occurrence of the specified strategy-classintReturns the index of the first occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class.booleanisEmpty()Returnstrueif this strategies list contains no strategy.iterator()intlastIndexOf(Class<?> strategyClass) Returns the index of the last occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class.booleanremoveIf(Predicate<ParameterResolvingStrategy> filter) Removes all the elements of this collection that satisfy the given predicate.booleanreplace(Class<?> strategyClass, ParameterResolvingStrategy strategy) Replaces the element at the specified position in this list with the specified strategy-class.resolveArgument(RequestContext context, ResolvableMethodParameter resolvable) Resolve parameterset(int idx, ParameterResolvingStrategy strategy) Replaces the element at the specified position in this list with the specified element.voidset(List<ParameterResolvingStrategy> resolver) set or clear resolversintsize()Returns the number of strategies in this list.booleansupportsParameter(ResolvableMethodParameter parameter) Whether the given parameter is supported by this resolver.toString()void
-
字段详细资料
-
strategies
-
-
构造器详细资料
-
ParameterResolvingStrategies
public ParameterResolvingStrategies() -
ParameterResolvingStrategies
public ParameterResolvingStrategies(int size) -
ParameterResolvingStrategies
ParameterResolvingStrategies(ArrayList<ParameterResolvingStrategy> strategies)
-
-
方法详细资料
-
supportsParameter
从接口复制的说明:ParameterResolvingStrategyWhether the given parameter is supported by this resolver.static match
- 指定者:
supportsParameter在接口中ParameterResolvingStrategy
-
resolveArgument
@Nullable public Object resolveArgument(RequestContext context, ResolvableMethodParameter resolvable) throws Throwable 从接口复制的说明:ParameterResolvingStrategyResolve parameter- 指定者:
resolveArgument在接口中ParameterResolvingStrategy- 参数:
context- Current request contextresolvable- resolvable parameter- 返回:
- method parameter instance
- 抛出:
Throwable- if anyExceptionoccurred- 另请参阅:
-
add
-
add
add resolvers or resolving-strategies- 参数:
resolver- resolvers or resolving-strategies
-
add
add resolvers or resolving-strategies- 参数:
resolvers- resolvers or resolving-strategies
-
set
set or clear resolvers- 参数:
resolver- can be null
-
get
Returns the instance of the first occurrence of the specified strategy-class- 参数:
strategyClass- strategy-class to search for- 返回:
- the instance of the first occurrence of the specified strategy-class
-
indexOf
Returns the index of the first occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class. More formally, returns the lowest indexisuch that -1 if there is no such index.- 参数:
strategyClass- strategy-class to search for- 返回:
- the index of the first occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class
-
lastIndexOf
Returns the index of the last occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class. More formally, returns the highest indexisuch that -1 if there is no such index.- 参数:
strategyClass- strategy-class to search for- 返回:
- the index of the last occurrence of the specified strategy-class in this list, or -1 if this list does not contain the strategy-class
-
set
Replaces the element at the specified position in this list with the specified element.- 参数:
idx- index of the element to replacestrategy- strategy to be stored at the specified position- 返回:
- the element previously at the specified position
- 抛出:
IndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
replace
Replaces the element at the specified position in this list with the specified strategy-class.- 参数:
strategyClass- strategy-class to search forstrategy- new strategy- 返回:
- if replaced
-
removeIf
Removes all the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.The default implementation traverses all elements of the collection using its
List.iterator(). Each matching element is removed usingIterator.remove(). If the collection's iterator does not support removal then anUnsupportedOperationExceptionwill be thrown on the first matching element.- 参数:
filter- a predicate which returnstruefor elements to be removed- 返回:
trueif any elements were removed- 抛出:
NullPointerException- if the specified filter is nullUnsupportedOperationException- if elements cannot be removed from this collection. Implementations may throw this exception if a matching element cannot be removed or if, in general, removal is not supported.
-
contains
Returns true if resolvers list contains the specifiedresolverClass. More formally, returns true if and only if all resolvers contains at least one element e such that (resolverClass == resolver.getClass()).- 参数:
strategyClass- element whose presence in this defaultResolvers or customizedResolvers is to be tested- 返回:
- true if resolvers contains the specified
resolverClass
-
trimToSize
public void trimToSize()- 指定者:
trimToSize在接口中cn.taketoday.core.ArraySizeTrimmer- 从以下版本开始:
- 4.0
-
getStrategies
-
iterator
- 指定者:
iterator在接口中Iterable<ParameterResolvingStrategy>
-
forEach
- 指定者:
forEach在接口中Iterable<ParameterResolvingStrategy>
-
spliterator
- 指定者:
spliterator在接口中Iterable<ParameterResolvingStrategy>
-
toString
-
size
public int size()Returns the number of strategies in this list.- 返回:
- the number of strategies in this list
-
isEmpty
public boolean isEmpty()Returnstrueif this strategies list contains no strategy.- 返回:
trueif this strategies list contains no strategy
-