Functions -
java
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 .
|
handle
, which refers to Java null.
handle nullHandle = java:createNull();
-
Return Type
(handle) The
handle
, which refers to Java null
handle
, which refers to the Java string representation of the Ballerina string
.
handle header = java:fromString("Content-Type");
Parameters
- value string
-
The Ballerina
string
with which thehandle
is created
-
Return Type
(handle) The
handle
, which refers to the Java String representation of the Ballerinastring
handle
, which refers to the Java Class object associated with the class or interface with the given
string name.
handle|error intClass = java:getClass("int");
This function performs a Java class.forName(name)
except for the following cases:
Name | Output |
---|---|
boolean | Java Class instance representing the primitive type boolean |
byte | Java Class instance representing the primitive type byte |
char | Java Class instance representing the primitive type char |
short | Java Class instance representing the primitive type short |
int | Java Class instance representing the primitive type int |
long | Java Class instance representing the primitive type long |
float | Java Class instance representing the primitive type float |
double | Java Class instance representing the primitive type double |
Parameters
- name string
-
The name of the Java class
-
Return Type
(handle | error) The Java Class object for the class with the given name
true
if this handle refers to Java null.
boolean status = java:isNull(value);
Parameters
- value handle
-
The
handle
of which the referred value is to be tested with Java null
-
Return Type
(boolean) true
if this handle refers to Java null
string
representation of the Java object referred by the handle
.
If the handle
refers to Java null, then this function returns a nil
value.
string? version = java:toString(versionProperty);
Parameters
- value handle
-
The
handle
of which the referred value is to be converted to a Ballerinastring
-
Return Type
(string?) The Ballerina
string
representation of the Java object referred by thehandle
or else returns()
if thehandle
refers to Java null