The javaLib.getField() system function returns the value of a specified field within a specified Java™ object or class in the EGL Java object space.
For more about the EGL Java object space in which javaLib.getField() and similar functions operate, see Java access functions. EGL maintains this method of Java access for compatibility with earlier versions. For new code, use the more powerful ExternalType syntax; for more information, see ExternalType part.
javaLib.getField( identifierOrClass javeObjIdOrClass in, field STRING in) returns (result anyJavaPrimitive)
For more information on mismatched lengths, see Assignments.
The following example shows the getField() function, with myID cast as objID:
myVar = javaLib.getField("myID" as "objID:java", "myField");
If the v60ExceptionCompatibility program property is not set, or is set to NO, an exception causes EGL to throw a JavaObjectException. Other errors cause EGL to throw a RuntimeException.
If the v60ExceptionCompatibility program property is set to YES, an error during processing of javaLib.getField() can set sysVar.errorCode to a value listed in the next table.
Value in sysVar.errorCode | Description |
---|---|
00001000 | An exception was thrown by an invoked method or as a result of a class initialization. |
00001001 | The object had a null value, or the specified identifier was not in the object space. |
00001002 | A public method, field, or class with the specified name does not exist or cannot be loaded. |
00001004 | The method returned a null value, the method does not return a value, or the value of a field was null. |
00001005 | The returned value does not match the type of the variable which you assigned it. |
00001007 | A SecurityException or IllegalAccessException was thrown during an attempt to get information about a method or field; or an attempt was made to set the value of a field that was declared final. |
00001009 | An identifier rather than a class name must be specified; the method or field is not static. |