Platforms to show: All Mac Windows Linux Cross-Platform
Back to JavaClassMBS class.
JavaClassMBS.AllocateObject as JavaObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Returns a reference to the object or nil on any error.
Does not work for array classes.
Throws InstantiationException if the class is an interface or an abstract class.
JavaClassMBS.CallStaticBooleanMethod(MethodID as JavaMethodMBS, args as memoryblock) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticByteMethod(MethodID as JavaMethodMBS, args as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticCharMethod(MethodID as JavaMethodMBS, args as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticDoubleMethod(MethodID as JavaMethodMBS, args as memoryblock) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticFloatMethod(MethodID as JavaMethodMBS, args as memoryblock) as single
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticIntMethod(MethodID as JavaMethodMBS, args as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticLongMethod(MethodID as JavaMethodMBS, args as memoryblock) as Int64
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticMain(args() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Some examples using this method:
JavaClassMBS.CallStaticMethod(MethodID as JavaMethodMBS, args() as Variant) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 19.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args variant array that immediately follows the methodID argument.
This is generic version, where our plugin translates between native Xojo data types and Java data types. We support conversion of boolean, byte (integer), char (integer), short (integer), int (integer), long (int64), double, float (single) and Java objects. Objects can be JavaObjectMBS or subclasses including JavaStringMBS and the JavaArrayMBS subclasses. For your convenience you can pass in string and we convert to JavaStringMBS for you.
JavaClassMBS.CallStaticObjectMethod(MethodID as JavaMethodMBS, args as memoryblock) as JavaObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
Some examples using this method:
JavaClassMBS.CallStaticShortMethod(MethodID as JavaMethodMBS, args as memoryblock) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
JavaClassMBS.CallStaticVoidMethod(MethodID as JavaMethodMBS, args as memoryblock)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This call invokes a static method on a Java object, according to the specified method ID. The methodID argument must be obtained by calling JavaClassMBS.GetMethod().
The method ID must be derived from this class, not from one of its superclasses.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
Some examples using this method:
JavaClassMBS.Constructor Private
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 13.1 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
JavaClassMBS.GetField(name as string, sig as string) as JavaFieldMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Nil on any error.
The signature is a string derived from the field's type or method's arguments and return type, as shown here:
Java Type | Signature |
boolean | Z |
byte | B |
char | C |
short | S |
int | I |
long | L |
float | F |
double | D |
void | V |
objects | Lfully-qualified-class-name; |
arrays | [array-type |
methods | (argument-types)return-type |
JavaClassMBS.GetMethod(name as string, sig as string) as JavaMethodMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Returns the method ID for an instance (non-static) method of a class or interface. The method may be defined in one of the the class's super classes and inherited by the class. The method is determined by its name and signature.
To obtain the method ID of a constructor, supply <init> as the method name and void (V) as the return type.
Nil on any error.
Throws NoSuchMethodError if the specified method cannot be found.
The signature is a string derived from the field's type or method's arguments and return type, as shown here:
Java Type | Signature |
boolean | Z |
byte | B |
char | C |
short | S |
int | I |
long | L |
float | F |
double | D |
void | V |
objects | Lfully-qualified-class-name; |
arrays | [array-type |
methods | (argument-types)return-type |
Some examples using this method:
JavaClassMBS.GetStaticField(name as string, sig as string) as JavaFieldMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Nil on any error.
Some examples using this method:
JavaClassMBS.GetStaticMethod(name as string, sig as string) as JavaMethodMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Nil on any error.
e.g. the signature of the default static main method is "([Ljava/lang/String;)V" which means return type void at the end and before an array of string.
Some examples using this method:
JavaClassMBS.NewObject(methodID as JavaMethodMBS, args as memoryblock) as JavaObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethod with <init> as the method name and void (V) as the return type.
Returns nil on any error.
Programmers place all arguments to the method in an args memoryblock that immediately follows the methodID argument.
In the memoryblock you need to use 8 bytes per argument and align them correctly. (alignment depends on platform)
Throws Java InstantiationException if the class is an interface or an abstract class.
See also:
JavaClassMBS.NewObject(MethodID as JavaMethodMBS, args() as Variant) as JavaObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 19.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
The method ID indicates which constructor method to invoke. This ID must be obtained by calling GetMethod with <init> as the method name and void (V) as the return type.
Returns nil on any error.
Programmers place all arguments to the method in an args variant array that immediately follows the methodID argument.
Throws Java InstantiationException if the class is an interface or an abstract class.
This is generic version, where our plugin translates between native Xojo data types and Java data types. We support conversion of boolean, byte (integer), char (integer), short (integer), int (integer), long (int64), double, float (single) and Java objects. Objects can be JavaObjectMBS or subclasses including JavaStringMBS and the JavaArrayMBS subclasses. For your convenience you can pass in string and we convert to JavaStringMBS for you.
See also:
JavaClassMBS.StaticBooleanField(TheField as JavaFieldMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticByteField(TheField as JavaFieldMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticCharField(TheField as JavaFieldMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticDoubleField(TheField as JavaFieldMBS) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticField(TheField as JavaFieldMBS) as Variant
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 19.4 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
This is generic version, where our plugin translates between native Xojo data types and Java data types. We support conversion of boolean, byte (integer), char (integer), short (integer), int (integer), long (int64), double, float (single) and Java objects. Objects can be JavaObjectMBS or subclasses including JavaStringMBS and the JavaArrayMBS subclasses. For your convenience you can pass in string and we convert to JavaStringMBS for you.
Do not use for generic fields!
(Read and Write computed property)
JavaClassMBS.StaticFloatField(TheField as JavaFieldMBS) as single
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticIntField(TheField as JavaFieldMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
Some examples using this property:
JavaClassMBS.StaticLongField(TheField as JavaFieldMBS) as Int64
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 11.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticObjectField(TheField as JavaFieldMBS) as JavaObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.StaticShortField(TheField as JavaFieldMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
JavaClassMBS.Superclass as JavaClassMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Java | MBS Java Plugin | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No | Desktop, Console & Web |
Nil if no superclass exists.
The items on this page are in the following plugins: MBS Java Plugin.