[Java] Class ReflectionMethodInvoker
- org.codehaus.groovy.runtime.ReflectionMethodInvoker
Utility class to call methods through reflection, and falls through using the Invoker
to call the method if it fails. The class is particularly useful for Groovy classes implementing GroovyInterceptable
, since it is not possible to call any method from this class, because it is intercepted by the invokeMethod()
method.
- Authors:
- Guillaume Laforge
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
static Object |
invoke(Object object, String methodName, Object[] parameters) Invoke a method through reflection. |
Inherited Methods Summary
Methods inherited from class | Name |
---|---|
class Object | wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail
public static Object invoke(Object object, String methodName, Object[] parameters)
Invoke a method through reflection. Falls through to using the Invoker to call the method in case the reflection call fails..
- Parameters:
-
object
- the object on which to invoke a method -
methodName
- the name of the method to invoke -
parameters
- the parameters of the method call
- Returns:
- the result of the method call
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/2.4.21/html/gapi/org/codehaus/groovy/runtime/ReflectionMethodInvoker.html