Module : java

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.

Records

ArrayType Represents a Java array type.
ConstructorData Describes a Java constructor.
FieldData Describes a Java field.
MethodData Describes a Java method.

Functions

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.

Annotations

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.