py4j.reflection

## Class MethodInvoker

- java.lang.Object
- - py4j.reflection.MethodInvoker

-     public class MethodInvoker
      extends java.lang.Object

  A MethodInvoker translates a call made in a Python Program into a call to a Java method.

  A MethodInvoker is tailored to a particular set of actual parameters and indicates how far the calling context is from the method signature.

  For example, a call to method1(String) from Python can be translated to a call to method1(char) in Java, with a cost of 1.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static MethodInvoker` | `INVALID_INVOKER`
    `static int` | `INVALID_INVOKER_COST`
    `static int` | `MAX_DISTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MethodInvoker(java.lang.reflect.Constructor<?> constructor, TypeConverter[] converters, int cost)`
    `MethodInvoker(java.lang.reflect.Method method, TypeConverter[] converters, int cost)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `buildConverters(java.util.List<TypeConverter> converters, java.lang.Class<?>[] parameters, java.lang.Class<?>[] arguments)` Builds a list of converters used to convert the arguments into the parameters.
    `static MethodInvoker` | `buildInvoker(java.lang.reflect.Constructor<?> constructor, java.lang.Class<?>[] arguments)`
    `static MethodInvoker` | `buildInvoker(java.lang.reflect.Method method, java.lang.Class<?>[] arguments)`
    `java.lang.reflect.Constructor<?>` | `getConstructor()`
    `java.util.List<TypeConverter>` | `getConverters()`
    `int` | `getCost()`
    `java.lang.reflect.Method` | `getMethod()`
    `java.lang.Object` | `invoke(java.lang.Object obj, java.lang.Object[] arguments)`
    `boolean` | `isVoid()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INVALID_INVOKER_COST

          public static final int INVALID_INVOKER_COST

      See Also:
        Constant Field Values

    - #### MAX_DISTANCE

          public static final int MAX_DISTANCE

      See Also:
        Constant Field Values

    - #### INVALID_INVOKER

          public static final MethodInvoker INVALID_INVOKER

  - ### Constructor Detail

    - #### MethodInvoker

          public MethodInvoker(java.lang.reflect.Constructor<?> constructor,
                               TypeConverter[] converters,
                               int cost)

    - #### MethodInvoker

          public MethodInvoker(java.lang.reflect.Method method,
                               TypeConverter[] converters,
                               int cost)

  - ### Method Detail

    - #### buildConverters

          public static int buildConverters(java.util.List<TypeConverter> converters,
                                            java.lang.Class<?>[] parameters,
                                            java.lang.Class<?>[] arguments)

      Builds a list of converters used to convert the arguments into the parameters.

      Parameters:
        `converters` -
        `parameters` -
        `arguments` -
      Returns:

    - #### buildInvoker

          public static MethodInvoker buildInvoker(java.lang.reflect.Constructor<?> constructor,
                                                   java.lang.Class<?>[] arguments)

    - #### buildInvoker

          public static MethodInvoker buildInvoker(java.lang.reflect.Method method,
                                                   java.lang.Class<?>[] arguments)

    - #### getConstructor

          public java.lang.reflect.Constructor<?> getConstructor()

    - #### getConverters

          public java.util.List<TypeConverter> getConverters()

    - #### getCost

          public int getCost()

    - #### getMethod

          public java.lang.reflect.Method getMethod()

    - #### invoke

          public java.lang.Object invoke(java.lang.Object obj,
                                         java.lang.Object[] arguments)

    - #### isVoid

          public boolean isVoid()