Example usage for Java org.springframework.core MethodParameter fields, constructors, methods, implement or subclass
The text is from its open source code.
MethodParameter(Method method, int parameterIndex) Create a new MethodParameter for the given method, with nesting level 1. | |
MethodParameter(Constructor> constructor, int parameterIndex) Create a new MethodParameter for the given constructor, with nesting level 1. | |
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. | |
MethodParameter(Method method, int parameterIndex, int nestingLevel) Create a new MethodParameter for the given method. | |
MethodParameter(Constructor> constructor, int parameterIndex, int nestingLevel) Create a new MethodParameter for the given constructor. | |
MethodParameter(Executable executable, int parameterIndex, @Nullable Class> containingClass) Internal constructor used to create a MethodParameter with a containing class already set. |
void | decreaseNestingLevel() Decrease this parameter's nesting level. |
MethodParameter | forExecutable(Executable executable, int parameterIndex) Create a new MethodParameter for the given method or constructor. |
MethodParameter | forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) Create a new MethodParameter for the given method or constructor. |
AnnotatedElement | getAnnotatedElement() Return the wrapped annotated element. |
Class> | getClass() Returns the runtime class of this Object . |
Constructor> | getConstructor() Return the wrapped Constructor, if any. |
Class> | getContainingClass() Return the containing class for this method parameter. |
Class> | getDeclaringClass() Return the class that declares the underlying Method or Constructor. |
Executable | getExecutable() Return the wrapped executable. |
Type | getGenericParameterType() Return the generic type of the method/constructor parameter. |
Method | getMethod() Return the wrapped Method, if any. |
A | getMethodAnnotation(Class annotationType) Return the method/constructor annotation of the given type, if available. |
Class> | getNestedParameterType() Return the nested type of the method/constructor parameter. |
A | getParameterAnnotation(Class annotationType) Return the parameter annotation of the given type, if available. |
Annotation[] | getParameterAnnotations() Return the annotations associated with the specific method/constructor parameter. |
int | getParameterIndex() Return the index of the method/constructor parameter. |
String | getParameterName() Return the name of the method/constructor parameter. |
Class> | getParameterType() Return the type of the method/constructor parameter. |
boolean | hasMethodAnnotation(Class annotationType) Return whether the method/constructor is annotated with the given type. |
boolean | hasParameterAnnotation(Class annotationType) Return whether the parameter is declared with the given annotation type. |
boolean | hasParameterAnnotations() Return true if the parameter has at least one annotation, false if it has none. |
void | increaseNestingLevel() Increase this parameter's nesting level. |
void | initParameterNameDiscovery(@Nullable ParameterNameDiscoverer parameterNameDiscoverer) Initialize parameter name discovery for this method parameter. |
boolean | isOptional() Return whether this method indicates a parameter which is not required: either in the form of Java 8's java.util.Optional , any variant of a parameter-level Nullable annotation (such as from JSR-305 or the FindBugs set of annotations), or a language-level nullable type declaration in Kotlin. |
MethodParameter | nested() Return a variant of this MethodParameter which points to the same parameter but one nesting level deeper. |
MethodParameter | nestedIfOptional() Return a variant of this MethodParameter which points to the same parameter but one nesting level deeper in case of a java.util.Optional declaration. |
void | setParameterType(@Nullable Class> parameterType) Set a resolved (generic) parameter type. |
void | setTypeIndexForCurrentLevel(int typeIndex) Set the type index for the current nesting level. |