public class ReflectionMethodAccess extends java.lang.Object implements MethodAccess
MethodAccess using reflection.| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Method |
method |
| Constructor and Description |
|---|
ReflectionMethodAccess(java.lang.reflect.Method method) |
| Modifier and Type | Method and Description |
|---|---|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass)
Get an annotation of the method.
|
int |
getModifiers() |
java.lang.String |
getName() |
int |
getParameterCount() |
java.lang.Class<?>[] |
getParameterTypes() |
java.lang.Class<?> |
getReturnType() |
java.lang.Object |
invoke(java.lang.Object instance,
java.lang.Object... args)
Invoke the method with the given instance and arguments.
|
public ReflectionMethodAccess(java.lang.reflect.Method method)
public java.lang.String getName()
getName in interface MethodAccessMethod.getName()public int getModifiers()
getModifiers in interface MethodAccessMethod.getModifiers()public int getParameterCount()
getParameterCount in interface MethodAccessMethod.getParameterCount()public java.lang.Class<?> getReturnType()
getReturnType in interface MethodAccessMethod.getReturnType()public java.lang.Class<?>[] getParameterTypes()
getParameterTypes in interface MethodAccessMethod.getParameterTypes()public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
MethodAccessgetAnnotation in interface MethodAccessT - The type of the annotationannotationClass - The class of the annotationAccessibleObject.getDeclaredAnnotation(Class)public java.lang.Object invoke(java.lang.Object instance,
java.lang.Object... args)
MethodAccessinvoke in interface MethodAccessinstance - The instance to invoke the method onargs - The arguments to pass to the methodMethod.invoke(Object, Object...)