|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.core.MethodParameter
public class MethodParameter
Helper class that encapsulates the specification of a method parameter, that is, a Method or Constructor plus a parameter index. Useful as a specification object to pass along.
Used by GenericCollectionTypeResolver, BeanWrapperImpl and AbstractBeanFactory.
GenericCollectionTypeResolver,
BeanWrapperImpl,
AbstractBeanFactory| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
decreaseNestingLevel()
Decrease this parameter's nesting level. |
static MethodParameter |
forMethodOrConstructor(Object methodOrConstructor,
int parameterIndex)
Create a new MethodParameter for the given method or constructor. |
Constructor |
getConstructor()
Return the Constructor held, if any. |
Method |
getMethod()
Return the Method held, if any. |
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). |
int |
getParameterIndex()
Return the index of the method/constructor parameter. |
void |
increaseNestingLevel()
Increase this parameter's nesting level. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodParameter(Method method,
int parameterIndex)
method - the Method to specify a parameter forparameterIndex - the index of the parameter
public MethodParameter(Method method,
int parameterIndex,
int nestingLevel)
method - the Method 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(Constructor constructor,
int parameterIndex)
constructor - the Constructor to specify a parameter forparameterIndex - the index of the parameter
public 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)| Method Detail |
|---|
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 int getParameterIndex()
public int getNestingLevel()
public void increaseNestingLevel()
getNestingLevel()public void decreaseNestingLevel()
getNestingLevel()
public static MethodParameter forMethodOrConstructor(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 parameter
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||