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_GetStaticMethodID

This function returns the method ID (Java handle) for a static method of a class.It is equivalent to the JNI function GetStaticMethodID.


Call

CALL 'JCI_GetStaticMethodID' USING cObj mName mSig mID

cObj

Class object

mName

Name of the method

mSig

Signature of the method

mID

Method ID returned by the function


Arguments

cObj

Data field of the type JCI-object
Object of the class in which the method is to be searched for.

mName

Structure of the type Cobvar
Name of the method which is to be searched for.
Trailing spaces at the end of the text are ignored.

mSig

Structure of the type Cobvar
Signature of the method which is to be searched for.
Trailing spaces at the end of the text are ignored.

mID

Data field of the type JCI-handle
After the function has been successfully executed, the field contains the method ID of the method 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-ENULLOBJ

cObj is JCI-NULL.

JCI-RET-EARGUMENT

cObj is not a class object.

JCI-RET-ENOTFOUND

The method could not be found.


Exceptions

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


Notes

The method is identified by the name and the signature. The signature can be received by the statement,

javap -s <class-name>

the <class-name> being the name of the class identified by cObj.


Example

DATA DIVISION.
WORKING-STORAGE SECTION.
COPY JCI-TYPEDEFS.
01 JCIConstants.
COPY JCI-CONST.
...
01 methodName.
05 PIC S9(9) COMP-5 VALUE 30.
05 PIC X(30) VALUE 'hello'.
01 methodSig.
05 PIC S9(9) COMP-5 VALUE 80.
05 PIC X(80) VALUE '(Ljava/lang/String;)V'.
...
01 classObj  TYPE JCI-object.
01 methodID  TYPE JCI-handle.
...
PROCEDURE DIVISION.
...
CALL 'JCI_GetStaticMethodID' USING classObj methodName
methodSig methodID
IF RETURN-CODE NOT = JCI-RET-OK
...