Input parameters specified with JavaSet* functions must exactly match the formal data type of the Java function. Some BDL functions, such as JavaSetNumber, can be used for more than one Java data type. The third optional parameter of the BDL function allows you to distinguish between the various Java data types (in the following example, byte, short, int, and long_.
Java code example
public void doFoo(byte b) {} public void doFoo(int i) {}
BDL code example
JavaSetNumber(hTestObj, 127, JAVA_BYTE); JavaCallMethod(hTestObj, "doFoo");
If the actual parameters specified by JavaSet* functions and the formal parameters of the Java method do not match, a java.lang.NoSuchMethodError exception will be thrown.
The following sample shows such a NoSuchMethodError.
Native: 1007 - Java Exception, Native Error 3: java.lang.NoSuchMethodError: doFoo, Test, doFoo((F))
The log output shows that no method named doFoo defined in a class Test could be found with the method signature doFoo((F)). As abbreviations for the method parameters, standard Java element type encoding is used.
<public user documents>\Silk Performer 21.0\Samples\JavaFramework\JavaFrameworkSample.bdf
<public user documents>\Silk Performer 21.0\Samples\JavaFramework\JavaFrameworkSample.java