Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Calls a method on an object.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Java | 6.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |
Parameter | Description | Example | Flags |
---|---|---|---|
JObject | The java object reference number. | $j | |
MethodName | The name of the method. | "test" | |
Signature | The java signature of the method. This describes the parameter types. Please use "javap -s test.class" with file path to class file to show the signatures for a class. |
"[]" | |
Params | The parameters to pass. Pass one parameter in FileMaker for each parameter to pass. |
Optional |
Returns OK or error.
Init a class and a call a merthod:
Set Variable [$j; Value:MBS( "Java.NewClassObject"; "test"; "<init>"; "()V")]
Set Variable [$r; Value:MBS( "Java.CallObjectMethod"; $j; "getValue"; "()I" )]
Show Custom Dialog ["value"; $r]
Set Variable [$r; Value:MBS( "Java.Release"; $j)]
Call method passing parameter and another to query:
Set Variable [$j; Value:MBS( "Java.NewClassObject"; "test"; "<init>"; "()V")]
Set Variable [$r; Value:MBS( "Java.CallObjectMethod"; $j; "setValue"; "(I)V"; 1234 )]
Set Variable [$r; Value:MBS( "Java.CallObjectMethod"; $j; "getValue"; "()I")]
Show Custom Dialog ["value"; $r]
Set Variable [$r; Value:MBS( "Java.Release"; $j)]
Call a void method
// public void DoSomething()
Set Variable [$r; Value:MBS( "Java.CallObjectMethod"; $j; "DoSomething"; "()V" )]
Created 2nd October 2016, last changed 22nd November 2018
JSON.ToXML - Java.CallStaticMethod
Feedback: Report problem or ask question.