public class MethodParameter
extends java.lang.Object
Title: MethodParameter.java
Description:
bboss workgroup
Copyright (c) 2007
| 构造器和说明 |
|---|
MethodParameter(java.lang.reflect.Constructor constructor,
int parameterIndex)
Create a new MethodParameter for the given constructor, with nesting
level 1.
|
MethodParameter(java.lang.reflect.Constructor constructor,
int parameterIndex,
int nestingLevel)
Create a new MethodParameter for the given constructor.
|
MethodParameter(java.lang.reflect.Method method,
int parameterIndex)
Create a new MethodParameter for the given method, with nesting level 1.
|
MethodParameter(java.lang.reflect.Method method,
int parameterIndex,
int nestingLevel)
Create a new MethodParameter for the given method.
|
MethodParameter(MethodParameter original)
Copy constructor, resulting in an independent MethodParameter object
based on the same metadata and cache state that the original object was
in.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
decreaseNestingLevel()
Decrease this parameter's nesting level.
|
static MethodParameter |
forMethodOrConstructor(java.lang.Object methodOrConstructor,
int parameterIndex)
Create a new MethodParameter for the given method or constructor.
|
AttributeWraper |
getAttribute() |
java.lang.reflect.Constructor |
getConstructor()
Return the wrapped Constructor, if any.
|
CookieValueWraper |
getCookieValue() |
Scope |
getDataBindScope() |
java.lang.Object |
getDefaultValue() |
EditorInf |
getEditor() |
MapKey |
getMapKey() |
java.lang.reflect.Method |
getMethod()
Return the wrapped Method, if any.
|
java.lang.String |
getMethodParameterName()
Return the name of the method/constructor parameter.
|
java.util.List<MethodParameter> |
getMultiAnnotationParams() |
int |
getNestingLevel()
Return the nesting level of the target type (typically 1; e.g. in case of
a List of Lists, 1 would indicate the nested List, whereas 2 would
indicate the element of the nested List).
|
java.lang.String |
getOrigineRequestParamName() |
PagerParamWraper |
getPagerParam() |
java.lang.Object[] |
getParameterAnnotations()
Return the annotations associated with the method/constructor parameter.
|
int |
getParameterIndex()
Return the index of the method/constructor parameter.
|
java.lang.Class |
getParameterType()
Return the type of the method/constructor parameter.
|
java.lang.String |
getParamNamePrefix() |
PathVariableWraper |
getPathVariable() |
RequestBodyWraper |
getRequestBody() |
RequestHeaderWraper |
getRequestHeader() |
RequestParamWraper |
getRequestParam() |
java.lang.String |
getRequestParameterName() |
java.util.List<ClassUtil.Var> |
getRequestParamNameToken() |
java.lang.Integer |
getTypeIndexForCurrentLevel()
Return the type index for the current nesting level.
|
java.lang.Integer |
getTypeIndexForLevel(int nestingLevel)
Return the type index for the specified nesting level.
|
java.util.Map |
getTypeVariableMap() |
void |
increaseNestingLevel()
Increase this parameter's nesting level.
|
void |
initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
Initialize parameter name discovery for this method parameter.
|
boolean |
isDataBeanBind() |
boolean |
isIsrequestbody() |
boolean |
isMultiAnnotations() |
boolean |
isNamevariabled() |
boolean |
isPrimaryType() |
boolean |
isRequired() |
boolean |
requestbody()
判断参数是否带requestbody注解
|
void |
setAttribute(AttributeWraper attribute) |
void |
setCookieValue(CookieValueWraper cookieValue) |
void |
setDataBeanBind(boolean dataBeanBind) |
void |
setDataBindScope(Scope requestScope) |
void |
setDefaultValue(java.lang.Object defaultValue) |
void |
setEditor(EditorInf editor) |
void |
setIsrequestbody(boolean isrequestbody) |
void |
setMapKey(MapKey mapKey) |
void |
setMultiAnnotationParams(java.util.List<MethodParameter> multiAnnotationParams) |
void |
setMultiAnnotations(boolean multiAnnotations) |
void |
setNamevariabled(boolean namevariabled) |
void |
setOrigineRequestParamName(java.lang.String origineRequestParamName) |
void |
setPagerParam(PagerParamWraper pagerParam) |
void |
setParameterName(java.lang.String parameterName) |
void |
setParamNamePrefix(java.lang.String paramNamePrefix) |
void |
setPathVariable(PathVariableWraper param) |
void |
setPrimaryType(boolean isPrimaryType) |
void |
setRequestBody(RequestBodyWraper requestBody) |
void |
setRequestHeader(RequestHeaderWraper requestHeader) |
void |
setRequestParam(RequestParamWraper requestParam) |
void |
setRequestParamNameToken(java.util.List<ClassUtil.Var> requestParamNameToken) |
void |
setRequired(boolean required) |
void |
setTypeIndexForCurrentLevel(int typeIndex)
Set the type index for the current nesting level.
|
protected void |
setTypeVariableMap(java.util.Map typeVariableMap) |
public MethodParameter(java.lang.reflect.Method method,
int parameterIndex)
method - the Method to specify a parameter forparameterIndex - the index of the parameterpublic MethodParameter(java.lang.reflect.Method method,
int parameterIndex,
int nestingLevel)
method - the Method to specify a parameter forparameterIndex - the index of the parameter (-1 for the method return type; 0
for the first method parameter, 1 for the second method
parameter, etc)nestingLevel - the nesting level of the target type (typically 1; e.g. in
case of a List of Lists, 1 would indicate the nested List,
whereas 2 would indicate the element of the nested List)public MethodParameter(java.lang.reflect.Constructor constructor,
int parameterIndex)
constructor - the Constructor to specify a parameter forparameterIndex - the index of the parameterpublic MethodParameter(java.lang.reflect.Constructor constructor,
int parameterIndex,
int nestingLevel)
constructor - the Constructor to specify a parameter forparameterIndex - the index of the parameternestingLevel - the nesting level of the target type (typically 1; e.g. in
case of a List of Lists, 1 would indicate the nested List,
whereas 2 would indicate the element of the nested List)public MethodParameter(MethodParameter original)
original - the original MethodParameter object to copy frompublic void setOrigineRequestParamName(java.lang.String origineRequestParamName)
public void setNamevariabled(boolean namevariabled)
public boolean isNamevariabled()
public java.lang.String getOrigineRequestParamName()
public java.util.List<ClassUtil.Var> getRequestParamNameToken()
public void setRequestParamNameToken(java.util.List<ClassUtil.Var> requestParamNameToken)
public java.lang.reflect.Method getMethod()
Note: Either Method or Constructor is available.
null if nonepublic java.lang.reflect.Constructor getConstructor()
Note: Either Method or Constructor is available.
null if nonepublic int getParameterIndex()
public java.lang.Class getParameterType()
null)public java.lang.Object[] getParameterAnnotations()
null if there is no
annotation support (on JDK < 1.5). The return value is an Object
array instead of an Annotation array simply for compatibility
with older JDKs; feel free to cast it to
Annotation[] on JDK 1.5 or higher.public void initParameterNameDiscovery(ParameterNameDiscoverer parameterNameDiscoverer)
This method does not actually try to retrieve the parameter name at this point; it just allows discovery to happen when the application calls
public java.lang.String getMethodParameterName()
null if no parameter name
metadata is contained in the class file or no
ParameterNameDiscoverer has
been set to begin with)public java.lang.String getRequestParameterName()
public void increaseNestingLevel()
getNestingLevel()public void decreaseNestingLevel()
getNestingLevel()public int getNestingLevel()
public void setTypeIndexForCurrentLevel(int typeIndex)
typeIndex - the corresponding type index (or null for the
default type index)getNestingLevel()public java.lang.Integer getTypeIndexForCurrentLevel()
null if none
specified (indicating the default type index)getNestingLevel()public java.lang.Integer getTypeIndexForLevel(int nestingLevel)
nestingLevel - the nesting level to checknull if none
specified (indicating the default type index)public static MethodParameter forMethodOrConstructor(java.lang.Object methodOrConstructor, int parameterIndex)
This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.
methodOrConstructor - the Method or Constructor to specify a parameter forparameterIndex - the index of the parameterpublic EditorInf getEditor()
public void setEditor(EditorInf editor)
public void setParameterName(java.lang.String parameterName)
public void setDataBeanBind(boolean dataBeanBind)
public boolean isDataBeanBind()
public void setDataBindScope(Scope requestScope)
public Scope getDataBindScope()
public void setRequired(boolean required)
public boolean isRequired()
public java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object defaultValue)
public boolean isMultiAnnotations()
public void setMultiAnnotations(boolean multiAnnotations)
public java.util.List<MethodParameter> getMultiAnnotationParams()
public void setMultiAnnotationParams(java.util.List<MethodParameter> multiAnnotationParams)
public java.util.Map getTypeVariableMap()
protected void setTypeVariableMap(java.util.Map typeVariableMap)
public java.lang.String getParamNamePrefix()
public void setParamNamePrefix(java.lang.String paramNamePrefix)
paramNamePrefix - the paramNamePrefix to setpublic RequestParamWraper getRequestParam()
public void setRequestParam(RequestParamWraper requestParam)
requestParam - the requestParam to setpublic void setPathVariable(PathVariableWraper param)
public PathVariableWraper getPathVariable()
public CookieValueWraper getCookieValue()
public void setCookieValue(CookieValueWraper cookieValue)
cookieValue - the cookieValue to setpublic AttributeWraper getAttribute()
public void setAttribute(AttributeWraper attribute)
attribute - the attribute to setpublic RequestHeaderWraper getRequestHeader()
public void setRequestHeader(RequestHeaderWraper requestHeader)
requestHeader - the requestHeader to setpublic void setMapKey(MapKey mapKey)
public MapKey getMapKey()
public boolean isPrimaryType()
public void setPrimaryType(boolean isPrimaryType)
public PagerParamWraper getPagerParam()
public void setPagerParam(PagerParamWraper pagerParam)
public boolean isIsrequestbody()
public void setIsrequestbody(boolean isrequestbody)
public RequestBodyWraper getRequestBody()
public void setRequestBody(RequestBodyWraper requestBody)
public boolean requestbody()