Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.runtime
[Java] Class ReflectionMethodInvoker

    java.lang.Object
      org.codehaus.groovy.runtime.ReflectionMethodInvoker

    public class ReflectionMethodInvoker
    extends java.lang.Object

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

Method Summary
`static java.lang.Object` | `invoke(java.lang.Object object, java.lang.String methodName, java.lang.Object[] parameters)` Invoke a method through reflection.

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Method Detail

### invoke

    public static java.lang.Object invoke(java.lang.Object object, java.lang.String methodName, java.lang.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

Groovy Documentation