py4j.reflection

## Class ReflectionEngine

- java.lang.Object
- - py4j.reflection.ReflectionEngine

-     public class ReflectionEngine
      extends Object

  The reflection engine is responsible for accessing the classes, the instances and members in a JVM.

  Author:
    Barthelemy Dagenais

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `cacheSize`
    `static Object` | `RETURN_VOID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReflectionEngine()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `createArray(String fqn, int[] dimensions)`
    `Class<?>` | `getClass(Class<?> clazz, String name)`
    `MethodInvoker` | `getConstructor(Class<?> clazz, Class<?>[] parameters)`
    `MethodInvoker` | `getConstructor(String classFQN, Object[] parameters)`
    `Field` | `getField(Class<?> clazz, String name)`
    `Field` | `getField(Object obj, String name)`
    `Field` | `getField(String classFQN, String name)`
    `Object` | `getFieldValue(Object obj, Field field)` Wrapper around Field.get
    `Method` | `getMethod(Class<?> clazz, String name)`
    `MethodInvoker` | `getMethod(Class<?> clazz, String name, Class<?>[] parameters)`
    `MethodInvoker` | `getMethod(Object object, String name, Object[] parameters)`
    `MethodInvoker` | `getMethod(String classFQN, String name, Object[] parameters)`
    `String[]` | `getPublicFieldNames(Object obj)` Retrieve the names of all the public fields in the obj
    `String[]` | `getPublicMethodNames(Object obj)` Retrieve the names of all the public methods in the obj
    `String[]` | `getPublicStaticClassNames(Class<?> clazz)` Retrieve the names of all the public static classes in the clazz
    `String[]` | `getPublicStaticFieldNames(Class<?> clazz)` Retrieve the names of all the public static fields in the clazz
    `String[]` | `getPublicStaticMethodNames(Class<?> clazz)` Retrieve the names of all the public static methods in the clazz
    `String[]` | `getPublicStaticNames(Class<?> clazz)` Retrieve the names of all the public static fields, methods and classes in the clazz
    `Object` | `invoke(Object object, MethodInvoker invoker, Object[] parameters)`
    `void` | `setFieldValue(Object obj, Field field, Object value)` Wrapper around Field.set

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

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

- - ### Field Detail

    - #### cacheSize

          public static int cacheSize

    - #### RETURN_VOID

          public static final Object RETURN_VOID

  - ### Constructor Detail

    - #### ReflectionEngine

          public ReflectionEngine()

  - ### Method Detail

    - #### createArray

          public Object createArray(String fqn,
                                    int[] dimensions)

    - #### getClass

          public Class<?> getClass(Class<?> clazz,
                                   String name)

    - #### getConstructor

          public MethodInvoker getConstructor(Class<?> clazz,
                                              Class<?>[] parameters)

    - #### getConstructor

          public MethodInvoker getConstructor(String classFQN,
                                              Object[] parameters)

    - #### getField

          public Field getField(Class<?> clazz,
                                String name)

      Parameters:
        `clazz` -
        `name` -
      Returns:
        The field or null if a field with this name does not exist in this class or in its hierarchy.

    - #### getField

          public Field getField(Object obj,
                                String name)

      Parameters:
        `obj` -
        `name` -
      Returns:
        The field or null if a field with this name does not exist in the class of this object or in its hierarchy.

    - #### getField

          public Field getField(String classFQN,
                                String name)

    - #### getFieldValue

          public Object getFieldValue(Object obj,
                                      Field field)

      Wrapper around Field.get

      Parameters:
        `obj` -
        `field` -
      Returns:

    - #### getMethod

          public Method getMethod(Class<?> clazz,
                                  String name)

    - #### getMethod

          public MethodInvoker getMethod(Class<?> clazz,
                                         String name,
                                         Class<?>[] parameters)

    - #### getMethod

          public MethodInvoker getMethod(Object object,
                                         String name,
                                         Object[] parameters)

    - #### getMethod

          public MethodInvoker getMethod(String classFQN,
                                         String name,
                                         Object[] parameters)

    - #### invoke

          public Object invoke(Object object,
                               MethodInvoker invoker,
                               Object[] parameters)

    - #### setFieldValue

          public void setFieldValue(Object obj,
                                    Field field,
                                    Object value)

      Wrapper around Field.set

      Parameters:
        `obj` -
        `field` -
        `value` -

    - #### getPublicMethodNames

          public String[] getPublicMethodNames(Object obj)

      Retrieve the names of all the public methods in the obj
      Parameters:
        `obj` - the object to inspect
      Returns:
        list of all the names of public methods in obj

    - #### getPublicFieldNames

          public String[] getPublicFieldNames(Object obj)

      Retrieve the names of all the public fields in the obj
      Parameters:
        `obj` - the object to inspect
      Returns:
        list of all the names of public fields in obj

    - #### getPublicStaticFieldNames

          public String[] getPublicStaticFieldNames(Class<?> clazz)

      Retrieve the names of all the public static fields in the clazz
      Parameters:
        `clazz` - the object to inspect
      Returns:
        list of all the names of public statics

    - #### getPublicStaticMethodNames

          public String[] getPublicStaticMethodNames(Class<?> clazz)

      Retrieve the names of all the public static methods in the clazz
      Parameters:
        `clazz` - the object to inspect
      Returns:
        list of all the names of public statics

    - #### getPublicStaticClassNames

          public String[] getPublicStaticClassNames(Class<?> clazz)

      Retrieve the names of all the public static classes in the clazz
      Parameters:
        `clazz` - the object to inspect
      Returns:
        list of all the names of public statics

    - #### getPublicStaticNames

          public String[] getPublicStaticNames(Class<?> clazz)

      Retrieve the names of all the public static fields, methods and classes in the clazz
      Parameters:
        `clazz` - the object to inspect
      Returns:
        list of all the names of public statics