public final class AcpMethodParameter
extends java.lang.Object
This class follows the Spring MVC pattern of pre-computing and caching parameter metadata for performance.
| 构造器和说明 |
|---|
AcpMethodParameter(java.lang.reflect.Method method,
int index)
Create a new AcpMethodParameter for a method parameter.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(java.lang.Object o) |
static AcpMethodParameter |
forReturnType(java.lang.reflect.Method method)
Create an AcpMethodParameter representing the return type.
|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationType)
Get a specific annotation if present.
|
java.lang.annotation.Annotation[] |
getAnnotations()
Get all annotations on this parameter.
|
java.lang.reflect.Type |
getGenericType()
Get the generic type, preserving type parameters.
|
int |
getIndex()
Get the parameter index (0-based), or -1 for return type.
|
java.lang.reflect.Method |
getMethod()
Get the method this parameter belongs to.
|
java.lang.String |
getName()
Get the parameter name (requires -parameters compiler flag).
|
java.lang.Class<?> |
getParameterType()
Get the parameter type, or return type if index is -1.
|
boolean |
hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Check if this parameter has the specified annotation.
|
int |
hashCode() |
boolean |
isReturnType()
Check if this represents a return type (index == -1).
|
java.lang.String |
toString() |
public AcpMethodParameter(java.lang.reflect.Method method,
int index)
method - the methodindex - the parameter index (0-based)public static AcpMethodParameter forReturnType(java.lang.reflect.Method method)
method - the methodpublic java.lang.reflect.Method getMethod()
public int getIndex()
public java.lang.String getName()
public java.lang.Class<?> getParameterType()
public java.lang.reflect.Type getGenericType()
public java.lang.annotation.Annotation[] getAnnotations()
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
A - the annotation typeannotationType - the annotation typepublic boolean hasAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType - the annotation typepublic boolean isReturnType()
public boolean equals(java.lang.Object o)
equals 在类中 java.lang.Objectpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic java.lang.String toString()
toString 在类中 java.lang.Object