Platforms to show: All Mac Windows Linux Cross-Platform

Back to JavaClassMBS class.

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
Get or set the value for a static boolean field in this class.

(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
Get or set the value for a static byte field in this class.

(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
Get or set the value for a static char field in this class.

(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
Get or set the value for a static double field in this class.

(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
Get or set the value for a static field in this class.
Example
Var jclass As JavaClassMBS=vm.FindClass("stringtest")

If jclass = Nil Then
MsgBox "Can't find stringtest class"
Return
End If

Var field As JavaFieldMBS = jclass.GetField("Name", "Ljava/lang/String;")
Var v As Variant = jclass.StaticField(field)
Var js As JavaStringMBS = v
MsgBox js

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
Get or set the value for a static float field in this class.

(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
Get or set the value for a static integer field in this class.
Example
Var f as FolderItem

f=SpecialFolder.Desktop.Child("ojdbc14.jar")

Var j as new JavaVMMBS(f)

Var c as JavaClassMBS = j.FindClass("oracle/jdbc/driver/OracleTypes")

Var field as JavaFieldMBS

// this are all static integer fields in this class:

field = c.GetStaticField("CURSOR","I")
MsgBox str(c.StaticIntField(field))

field = c.GetStaticField("BLOB","I")
MsgBox str(c.StaticIntField(field))

field = c.GetStaticField("DOUBLE","I")
MsgBox str(c.StaticIntField(field))

(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
Get or set the value for a static long field in this class.

(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
Get or set the value for a static object field in this class.

(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
Get or set the value for a static short field in this class.

(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
Points to the superclass of this class.

Nil if no superclass exists.

The items on this page are in the following plugins: MBS Java Plugin.


The biggest plugin in space...