Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

JCI_FindClass

This function localizes and loads a class.
It is equivalent to the JNI function FindClass.


Call

CALL 'JCI_FindClass' USING cName cObj

cName

Name of the class

cObj

Class object returned by the function


Arguments

cName

Structure of the type Cobvar
Fully qualified name of the class (i.e. a package-name separated by "/" followed by the name and class) which is to be searched for. If the name begins with "[" (array signature character), an array class is returned.
Trailing spaces at the end of the text are ignored.

cObj

Data field of the type JCI-object
After the function has been successfully executed, the field contains a class object of the class being searched for.
In the event of an error, the value JCI-NULL is returned.


Return value (RETURN-CODE)

JCI-RET-OK

The call was successful.

JCI-RET-ENOVM

No Java VM has been started.

JCI-RET-ENOTFOUND

The class could not be loaded.


Exceptions

The exceptions generated by the function correspond to those of the JNI function FindClass.


Example

DATA DIVISION.
WORKING-STORAGE SECTION.
COPY JCI-TYPEDEFS.
01 JCIConstants.
COPY JCI-CONST.
...
01 className.
02 PIC S9(9) USAGE COMP-5 VALUE 30.
02 PIC X(30) VALUE 'Hello'.
...
01 classObj TYPE JCI-object.
...
PROCEDURE DIVISION.
...
CALL 'JCI_FindClass' USING className classObj
IF RETURN-CODE NOT = JCI-RET-OK
...