public class MethodParameter extends Object
GenericCollectionTypeResolver| Constructor and Description |
|---|
MethodParameter(Constructor constructor,
int parameterIndex)
Create a new MethodParameter for the given constructor, with nesting level 1.
|
MethodParameter(Constructor constructor,
int parameterIndex,
int nestingLevel)
Create a new MethodParameter for the given constructor.
|
MethodParameter(Method method,
int parameterIndex)
Create a new MethodParameter for the given method, with nesting level 1.
|
MethodParameter(Method method,
int parameterIndex,
int nestingLevel)
Create a new MethodParameter for the given method.
|
| Modifier and Type | Method and Description |
|---|---|
Constructor |
getConstructor()
Return the wrapped Constructor, if any.
|
Class |
getDeclaringClass()
Return the class that declares the underlying Method or Constructor.
|
Method |
getMethod()
Return the wrapped Method, if any.
|
Annotation[] |
getMethodAnnotations()
Return the annotations associated with the target method/constructor itself.
|
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).
|
Annotation[] |
getParameterAnnotations()
Return the annotations associated with the specific method/constructor parameter.
|
int |
getParameterIndex()
Return the index of the method/constructor parameter.
|
Class<?> |
getParameterType()
Return the type of the method/constructor parameter.
|
Integer |
getTypeIndexForLevel(int nestingLevel)
Return the type index for the specified nesting level.
|
public MethodParameter(Method method, int parameterIndex)
method - the Method to specify a parameter forparameterIndex - the index of the parameterpublic MethodParameter(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(Constructor constructor, int parameterIndex)
constructor - the Constructor to specify a parameter forparameterIndex - the index of the parameterpublic MethodParameter(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 Method getMethod()
Note: Either Method or Constructor is available.
null if nonepublic Constructor getConstructor()
Note: Either Method or Constructor is available.
null if nonepublic Class getDeclaringClass()
public int getParameterIndex()
public Class<?> getParameterType()
null)public Annotation[] getMethodAnnotations()
public Annotation[] getParameterAnnotations()
public int getNestingLevel()
public Integer getTypeIndexForLevel(int nestingLevel)
nestingLevel - the nesting level to checknull
if none specified (indicating the default type index)Copyright © 2008–2022. All rights reserved.