java.lang.Object | |
↳ | org.springframework.core.MethodParameter |
Helper class that encapsulates the specification of a method parameter, i.e. a Method or Constructor plus a parameter index and a nested type index for a declared generic type. Useful as a specification object to pass along.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new MethodParameter for the given method, with nesting level 1.
| |||||||||||
Create a new MethodParameter for the given method.
| |||||||||||
Create a new MethodParameter for the given constructor, with nesting level 1.
| |||||||||||
Create a new MethodParameter for the given constructor.
| |||||||||||
Copy constructor, resulting in an independent MethodParameter object
based on the same metadata and cache state that the original object was in.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Decrease this parameter's nesting level.
| |||||||||||
Create a new MethodParameter for the given method or constructor.
| |||||||||||
Return the wrapped Constructor, if any.
| |||||||||||
Return the class that declares the underlying Method or Constructor.
| |||||||||||
Return the generic type of the method/constructor parameter.
| |||||||||||
Return the wrapped Method, if any.
| |||||||||||
Return the method/constructor annotation of the given type, if available.
| |||||||||||
Return the annotations associated with the target method/constructor itself.
| |||||||||||
Return the nesting level of the target type
(typically 1; e.g.
| |||||||||||
Return the parameter annotation of the given type, if available.
| |||||||||||
Return the annotations associated with the specific method/constructor parameter.
| |||||||||||
Return the index of the method/constructor parameter.
| |||||||||||
Return the name of the method/constructor parameter.
| |||||||||||
Return the type of the method/constructor parameter.
| |||||||||||
Return the type index for the current nesting level.
| |||||||||||
Return the type index for the specified nesting level.
| |||||||||||
Increase this parameter's nesting level.
| |||||||||||
Initialize parameter name discovery for this method parameter.
| |||||||||||
Set the type index for the current nesting level.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new MethodParameter for the given method, with nesting level 1.
method | the Method to specify a parameter for |
---|---|
parameterIndex | the index of the parameter |
Create a new MethodParameter for the given method.
method | the Method to specify a parameter for |
---|---|
parameterIndex | 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) |
Create a new MethodParameter for the given constructor, with nesting level 1.
constructor | the Constructor to specify a parameter for |
---|---|
parameterIndex | the index of the parameter |
Create a new MethodParameter for the given constructor.
constructor | the Constructor to specify a parameter for |
---|---|
parameterIndex | the index of the parameter |
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) |
Copy constructor, resulting in an independent MethodParameter object based on the same metadata and cache state that the original object was in.
original | the original MethodParameter object to copy from |
---|
Decrease this parameter's nesting level.
Create a new MethodParameter for the given method or constructor.
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 for |
---|---|
parameterIndex | the index of the parameter |
Return the wrapped Constructor, if any.
Note: Either Method or Constructor is available.
null
if none
Return the class that declares the underlying Method or Constructor.
Return the generic type of the method/constructor parameter.
null
)
Return the wrapped Method, if any.
Note: Either Method or Constructor is available.
null
if none
Return the method/constructor annotation of the given type, if available.
annotationType | the annotation type to look for |
---|
null
if not found
Return the annotations associated with the target method/constructor itself.
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).
Return the parameter annotation of the given type, if available.
annotationType | the annotation type to look for |
---|
null
if not found
Return the annotations associated with the specific method/constructor parameter.
Return the index of the method/constructor parameter.
Return the name of the method/constructor parameter.
null
if no
parameter name metadata is contained in the class file or no
ParameterNameDiscoverer
has been set to begin with)
Return the type of the method/constructor parameter.
null
)
Return the type index for the current nesting level.
null
if none specified (indicating the default type index)Return the type index for the specified nesting level.
nestingLevel | the nesting level to check |
---|
null
if none specified (indicating the default type index)
Increase this parameter's nesting level.
Initialize parameter name discovery for this method parameter.
This method does not actually try to retrieve the parameter name at
this point; it just allows discovery to happen when the application calls
getParameterName()
(if ever).
Set the type index for the current nesting level.
typeIndex | the corresponding type index
(or null for the default type index) |
---|