ballerina/jballerina.java0.9.0

Module Overview

This module provides the API for Java interoperability in Ballerina. It includes a set of Ballerina annotations with which Java constructors, methods, and fields can provide implementations of Ballerina functions with external function bodies.

For information on the operations, which you can perform with the Java module, see the below Functions. For examples on the usage of the operations, see the following.

Functions

[6]

cast

Returns an `JObject|error`, which is obtained after casting the provided `JObject` instance to the given `JObject` type depending on assignability.

createNull

Returns a `handle`, which refers to Java null.

fromString

Returns a `handle`, which refers to the Java string representation of the Ballerina `string`.

getClass

Returns a `handle`, which refers to the Java Class object associated with the class or interface with the given string name.

isNull

Returns `true` if this handle refers to Java null.

toString

Returns a Ballerina `string` representation of the Java object referred by the `handle`.

Classes

[1]

StackFrameImpl

Implementation for the `runtime.StackFrame`.

Object Types

[1]

JObject

The Ballerina abstract object which is to be extended by Ballerina objects representing Ballerina bindings for Java classes.

Records

[5]

ArrayType

Represents a Java array type.

ConstructorData

Describes a Java constructor.

FieldData

Describes a Java field.

MethodData

Describes a Java method.

ObjectData

Describes a Java class that corresponds to a Ballerina object.

Annotations

[5]

Binding

Describes the Java class representing a Ballerina binding.

Constructor

Describes a Java constructor, which provides an implementation of a Ballerina function of which the body is marked as `external`.

FieldGet

Describes a Java Field access, which provides an implementation of a Ballerina function of which the body is marked as `external`.

FieldSet

Describes a Java Field mutate, which provides an implementation of a Ballerina function of which the body is marked as `external`.

Method

Describes a Java method, which provides an implementation of a Ballerina function of which the body is marked as `external`.

Errors

[1]

JavaClassNotFoundError

Represents a `JavaError` with the message and the cause.