Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

Java.GetStaticField

Queries a static field on a class.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Java 6.5 Yes Yes Yes Yes No

MBS( "Java.GetStaticField"; ClassName; FieldName; Signature )

Parameters

Parameter Description Example value
ClassName The name of the java class. "com.mbs.test"
FieldName The name of the field. "test"
Signature The java signature of the field.
This describes the data type of the field.
"I"

Result

Returns value or error.

Description

Queries a static field on a class.
This is like a global variable as there is only one value for all objects of the class.
Data type is automatically detected by plugin from signature.
If you read an object value, please call Java.Release later for it.

Java is only available if you call Java.Initialize before to load the java runtime.
Supported data types include: void, int, long, boolean, string, double, float, char, byte, object, byte array (for container), char array (using FileMaker text).

Examples

Test static field:

Set Variable [$r; Value:MBS( "Java.SetStaticField"; "test"; "n"; "I"; 3456)]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "test"; "n"; "I")]
Show Custom Dialog ["value"; $r]

Query various static fields:

Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_boolean"; "Z")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_byte"; "B")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_byteArray"; "[B")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_char"; "C")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_charArray"; "[C")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_double"; "D")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_float"; "F")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_int"; "I")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_long"; "J")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_short"; "S")]
Set Variable [$r; Value:MBS( "Java.GetStaticField"; "tests"; "static_property_string"; "Ljava/lang/String;")]

See also

Example Databases


Java.GetObjectField   -   Java.Initialize

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins