jpy#

Bi-directional Python-Java Bridge

exception JException#

Bases: Exception

with_traceback()#

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class JField#

Bases: object

Java Field Wrapper

is_final#

Tests if this is a final field

is_static#

Tests if this is a static field

name#

Field name

class JMethod#

Bases: object

Java Method Wrapper

get_param_type()#

Gets the type of the parameter given by index

is_param_mutable()#

Tests if the method parameter given by index is mutable

is_param_output()#

Tests if the method parameter given by index is a mere output value (and not read from)

is_param_return()#

Tests if the method parameter given by index is the return value

is_static#

Tests if this is a static method

name#

Method name

param_count#

Number of method parameters

set_param_mutable()#

Sets whether the method parameter given by index is mutable

set_param_output()#

Sets whether the method parameter given by index is a mere output value (and not read from)

set_param_return()#

Sets whether the method parameter given by index is the return value

class JOverloadedMethod#

Bases: object

Java Overloaded Method

decl_class#

Declaring Java class

methods#

List of methods

name#

Overloaded method name

class JType#

Bases: object

Java Meta Type

array()#

array(name, init) - Return a new Java array of given Java type (type name or type object) and initializer (array length or sequence). Possible primitive types are ‘boolean’, ‘byte’, ‘char’, ‘short’, ‘int’, ‘long’, ‘float’, and ‘double’.

byte_buffer()#

byte_buffer(obj) - Return a new Java direct ByteBuffer sharing the same underlying, contiguous buffer of obj via its implemented Buffer Protocol. The resulting PYObject must live longer than the Java object to ensure the underlying data remains valid. In most cases, this means that java functions called in this manner must not keep any references to the ByteBuffer

cast()#

cast(obj, type) - Cast the given Java object to the given Java type (type name or type object). Returns None if the cast is not possible.

create_jvm()#

create_jvm(options) - Create the Java VM from the given list of options.

destroy_jvm()#

destroy_jvm() - Destroy the current Java VM.

get_type()#

get_type(name, resolve=True) - Return the Java class with the given name, e.g. ‘java.io.File’. Loads the Java class from the JVM if not already done. Optionally avoids resolving the class’ methods.

has_jvm()#

has_jvm() - Check if the JVM is available.