PyProxy (Jython API documentation)
Date: 2024-08-18

org.python.core

## Interface PyProxy

-     public interface PyProxy

  Common methods for all generated proxy classes. Proxy classes are created whenever a python class inherits from a java class. Instances of such a python class consists of two objects:
  - An instance of the proxy class. The _getPyInstance() will return a reference to the PyInstance.
  - An instance of PyInstance. The PyInstance's java proxy attribute contains a reference to the proxy class instance.
  All proxy classes implement this interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `__initProxy__(java.lang.Object[] args)` Initialize the proxy instance.
    `PyObject` | `_getPyInstance()` Return the associated PyObject.
    `PySystemState` | `_getPySystemState()` Return the associated system state.
    `void` | `_setPyInstance(PyObject proxy)` Associate a PyObject with this proxy instance.
    `void` | `_setPySystemState(PySystemState ss)` Associate an system state with this proxy instance.

- - ### Method Detail

    - #### _setPyInstance

          void _setPyInstance(PyObject proxy)

      Associate a PyObject with this proxy instance. This is done during construction and initialization of the proxy instance.

    - #### _getPyInstance

          PyObject _getPyInstance()

      Return the associated PyObject.

    - #### _setPySystemState

          void _setPySystemState(PySystemState ss)

      Associate an system state with this proxy instance. This is done during construction and initialization of the proxy instance.

    - #### _getPySystemState

          PySystemState _getPySystemState()

      Return the associated system state.

    - #### __initProxy__

          void __initProxy__(java.lang.Object[] args)

      Initialize the proxy instance. If the proxy is not initialized, this will call the python constructor with `args`.

      In some situations is it necessary to call the __initProxy__ method from the java superclass ctor before the ctor makes call to methods that is overridden in python.

      In most situation the __initProxy__ is called automatically by the jython runtime.

Jython homepage