类 ResolvableMethodParameter
java.lang.Object
cn.taketoday.core.AttributeAccessorSupport
cn.taketoday.web.handler.method.ResolvableMethodParameter
- 所有已实现的接口:
cn.taketoday.core.AttributeAccessor,Serializable
- 直接已知子类:
ParameterResolverMethodParameter
public class ResolvableMethodParameter
extends cn.taketoday.core.AttributeAccessorSupport
Abstraction for Parameter
this Class supports resolving its parameter in a RequestContext
provides some common information like 'required','defaultValue', see more
RequestParam
- 从以下版本开始:
- 2.3.7
- 作者:
- TODAY
- 另请参阅:
-
MethodParameterresolveParameter(RequestContext)Nullable- 序列化表格
-
字段概要
字段修饰符和类型字段说明private NamedValueInfoprivate ResolvableMethodParameterprivate final cn.taketoday.core.MethodParameterprivate cn.taketoday.core.ResolvableTypeprotected cn.taketoday.core.TypeDescriptor从类继承的字段 cn.taketoday.core.AttributeAccessorSupport
attributes -
构造器概要
构造器构造器说明ResolvableMethodParameter(cn.taketoday.core.MethodParameter parameter) ResolvableMethodParameter(ResolvableMethodParameter other, cn.taketoday.core.MethodParameter parameter) -
方法概要
修饰符和类型方法说明protected NamedValueInfoCreate theNamedValueInfoobject for the given method parameter.protected cn.taketoday.core.TypeDescriptorbooleanClass<?>Return the wrapped Method, if any.<A extends Annotation>
AgetMethodAnnotation(Class<A> annotationType) Return the method annotation of the given type, if available.Return the annotations associated with the target method itself.getName()Obtain the named value for the given method parameter.cn.taketoday.core.MethodParameter<A extends Annotation>
AgetParameterAnnotation(Class<A> annotationType) Return the parameter annotation of the given type, if available.Return the annotations associated with the specific method parameter.intClass<?>cn.taketoday.core.ResolvableTypecn.taketoday.core.TypeDescriptorinthashCode()<A extends Annotation>
booleanhasMethodAnnotation(Class<A> annotationType) Return whether the method is annotated with the given type.booleanbooleanhasParameterAnnotation(Class<? extends Annotation> annotationType) Return whether the parameter is declared with the given annotation type.booleanReturntrueif the parameter has at least one annotation,falseif it has none.booleanbooleanisArray()booleanisAssignableTo(Class<?> superClass) booleanbooleanisInstance(Object obj) booleanbooleanbooleanReturn whether this method indicates a parameter which can benull: either in the form of any variant of a parameter-levelNullableannotation (such as from JSR-305 or the FindBugs set of annotations), or a language-level nullable type declarationbooleanReturn whether this method indicates a parameter which is not required: either in the form of Java 8'sOptional, any variant of a parameter-levelNullableannotation (such as from JSR-305 or the FindBugs set of annotations), or a language-level nullable type declaration orContinuationparameter in Kotlin.booleannested()Return a variant of thisResolvableMethodParameterwhich points to the same parameter but one nesting level deeper.protected ResolvableMethodParameternested(cn.taketoday.core.MethodParameter parameter) Return a variant of thisResolvableMethodParameterwhich points to the same parameter but one nesting level deeper.Return a variant of thisMethodParameterwhich points to the same parameter but one nesting level deeper in case of aOptionaldeclaration.resolveParameter(RequestContext request) simple impltoString()private NamedValueInfoCreate a new NamedValueInfo based on the given NamedValueInfo with sanitized values.voidwithNamedValueInfo(NamedValueInfo namedValueInfo) 从类继承的方法 cn.taketoday.core.AttributeAccessorSupport
attributeNames, clearAttributes, computeAttribute, copyAttributesFrom, createAttributes, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttributes, removeAttribute, setAttribute
-
字段详细资料
-
typeDescriptor
@Nullable protected cn.taketoday.core.TypeDescriptor typeDescriptor- 从以下版本开始:
- 3.0.1
-
parameter
private final cn.taketoday.core.MethodParameter parameter -
namedValueInfo
-
resolvableType
@Nullable private cn.taketoday.core.ResolvableType resolvableType -
nestedParam
-
-
构造器详细资料
-
ResolvableMethodParameter
- 从以下版本开始:
- 4.0
-
ResolvableMethodParameter
public ResolvableMethodParameter(cn.taketoday.core.MethodParameter parameter) -
ResolvableMethodParameter
ResolvableMethodParameter(ResolvableMethodParameter other, cn.taketoday.core.MethodParameter parameter)
-
-
方法详细资料
-
isArray
public boolean isArray() -
isCollection
public boolean isCollection() -
isInterface
public boolean isInterface() -
is
-
isAssignableTo
-
isInstance
-
getMethodAnnotations
Return the annotations associated with the target method itself. -
getMethodAnnotation
Return the method annotation of the given type, if available.- 参数:
annotationType- the annotation type to look for- 返回:
- the annotation object, or
nullif not found
-
hasMethodAnnotation
Return whether the method is annotated with the given type.- 参数:
annotationType- the annotation type to look for- 另请参阅:
-
getParameterAnnotations
Return the annotations associated with the specific method parameter. -
hasParameterAnnotations
public boolean hasParameterAnnotations()Returntrueif the parameter has at least one annotation,falseif it has none. -
hasParameterAnnotation
Return whether the parameter is declared with the given annotation type.- 参数:
annotationType- the annotation type to look for- 另请参阅:
-
getParameterAnnotation
Return the parameter annotation of the given type, if available.- 参数:
annotationType- the annotation type to look for- 返回:
- the annotation object, or
nullif not found
-
getResolvableType
public cn.taketoday.core.ResolvableType getResolvableType() -
hasNamedValueInfo
public boolean hasNamedValueInfo() -
getNamedValueInfo
Obtain the named value for the given method parameter. -
isRequired
public boolean isRequired() -
isNotRequired
public boolean isNotRequired() -
getName
-
getDefaultValue
-
withNamedValueInfo
-
createNamedValueInfo
Create theNamedValueInfoobject for the given method parameter. Implementations typically retrieve the method annotation by means ofMethodParameter.getParameterAnnotation(Class).- 返回:
- the named value information
-
updateNamedValueInfo
Create a new NamedValueInfo based on the given NamedValueInfo with sanitized values.- 另请参阅:
-
Nullable
-
getParameterName
-
getParameterIndex
public int getParameterIndex() -
getMethod
Return the wrapped Method, if any.- 返回:
- the Method
-
resolveParameter
simple impl- 参数:
request- Current request context- 返回:
- parameter object
- 抛出:
Throwable
-
getParameterType
-
getComponentType
-
getParameter
public cn.taketoday.core.MethodParameter getParameter() -
isOptional
public boolean isOptional()Return whether this method indicates a parameter which is not required: either in the form of Java 8'sOptional, any variant of a parameter-levelNullableannotation (such as from JSR-305 or the FindBugs set of annotations), or a language-level nullable type declaration orContinuationparameter in Kotlin.- 从以下版本开始:
- 4.0
-
isNullable
public boolean isNullable()Return whether this method indicates a parameter which can benull: either in the form of any variant of a parameter-levelNullableannotation (such as from JSR-305 or the FindBugs set of annotations), or a language-level nullable type declaration- 从以下版本开始:
- 4.0
-
nestedIfOptional
Return a variant of thisMethodParameterwhich points to the same parameter but one nesting level deeper in case of aOptionaldeclaration.- 从以下版本开始:
- 4.0
- 另请参阅:
-
nested
Return a variant of thisResolvableMethodParameterwhich points to the same parameter but one nesting level deeper.- 从以下版本开始:
- 4.0
-
nested
Return a variant of thisResolvableMethodParameterwhich points to the same parameter but one nesting level deeper.- 参数:
typeIndex- the type index for the new nesting level- 从以下版本开始:
- 4.0
-
nested
-
getTypeDescriptor
public cn.taketoday.core.TypeDescriptor getTypeDescriptor()- 从以下版本开始:
- 3.0.1
-
createTypeDescriptor
protected cn.taketoday.core.TypeDescriptor createTypeDescriptor()- 从以下版本开始:
- 4.0
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中cn.taketoday.core.AttributeAccessorSupport
-
toString
-
equals
- 覆盖:
equals在类中cn.taketoday.core.AttributeAccessorSupport
-