@Api public class InvocableMethod extends Object
ParameterBinder
.Constructor and Description |
---|
InvocableMethod(Method method) |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getDeclaringClass()
Returns class that declared this method
Method.getDeclaringClass() |
Method |
getMethod()
Returns original method
|
Annotation |
getParameterAnnotation(int index,
Class<? extends Annotation> annotationType)
Returns parameter annotation of given class by parameter index.
|
Class<?> |
getParameterClass(int index)
Returns parameter class by parameter index.
|
int |
getParameterCount()
Returns parameter count
|
String |
getParameterName(int index)
Returns parameter name.
|
boolean |
hasParameterAnnotation(int index,
Class<? extends Annotation> annotationType)
Returns true if parameter has given annotation.
|
Object |
invoke(Object instance,
ParameterBinder... binders)
Invokes this method on given instance (may be null for static methods).
|
String |
toString() |
public InvocableMethod(Method method)
public Method getMethod()
public Class<?> getDeclaringClass()
Method.getDeclaringClass()
public int getParameterCount()
public Class<?> getParameterClass(int index)
index
- parameter indexpublic Annotation getParameterAnnotation(int index, Class<? extends Annotation> annotationType)
index
- parameter indexannotationType
- annotation classpublic boolean hasParameterAnnotation(int index, Class<? extends Annotation> annotationType)
index
- parameter indexannotationType
- annotation classpublic String getParameterName(int index)
Param
annotation or using
LocalVariableTableParameterNameDiscoverer
that reads parameter names form debug
informations.index
- parameter indexpublic Object invoke(Object instance, ParameterBinder... binders) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
Binders are invoked in specified order.
instance
- instance on which method will be invokedbinders
- parameter bindersIllegalAccessException
IllegalArgumentException
InvocationTargetException
Method.invoke(Object, Object...)
Copyright © 2019 Suncode. All rights reserved.