Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

JavaVMMBS.NewObjectArray(size as Integer, TheClass as JavaClassMBS, InitialValue as JavaObjectMBS) as JavaObjectArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Constructs a new array holding objects in class elementClass.
Notes:
All elements are initially set to initialElement.
Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewShortArray(ref as JavaObjectMBS) as JavaShortArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.3 Yes Yes Yes Yes No
Function: Creates a new array object based on the given java object.
Notes: This function is a convenience function to convert a java object array reference to a java array object in REALbasic. It can crash if the java object used is not the array of the requested type.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewShortArray(size as Integer) as JavaShortArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new array for shorts with the given size.
Notes: Returns nil on any error.

See also:

Feedback, Comments & Corrections

JavaVMMBS.NewStringUnicode(s as string) as JavaStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new string.
Notes: Preferres an Unicode encoded string.

Feedback, Comments & Corrections

JavaVMMBS.NewStringUTF8(s as string) as JavaStringMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new string.
Example:
// init Java
dim options() as string
dim javaVm as new JavaVMMBS(JavaVMMBS.JNI_VERSION_1_4, options, true)

// Get system class
Dim system As JavaClassMBS = javaVm.FindClass("java/lang/System")

If system <> Nil Then

// query method
dim transfomerGetPropertyId as JavaMethodMBS = system.GetStaticMethod("getProperty", "(Ljava/lang/String;)Ljava/lang/String;")
If transfomerGetPropertyId <> Nil Then

// make parameters
Dim keyString As JavaStringMBS = javaVm.NewStringUTF8("os.version")
dim m as New MemoryBlock(8)
m.long(0)=keyString.Handle

// run it
dim r as JavaObjectMBS = system.CallStaticObjectMethod(transfomerGetPropertyId, m)

if r<>Nil then
// show result
dim s as JavaStringMBS = JavaStringMBS(r)
MsgBox s.CopyStringUTF
end if

End If
End If
Notes: Preferres an UTF8 encoded string.

Feedback, Comments & Corrections

JavaVMMBS.Runtime as JavaRuntimeMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 8.5 Yes Yes Yes Yes No
Function: Returns the runtime object for the current VM so you can query the memory statistics.

Feedback, Comments & Corrections

JavaVMMBS.ToReflectedField(TheClass as JavaClassMBS, fieldID as JavaFieldMBS, isStatic as boolean) as JavaObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new reflected field object for the given field.

Feedback, Comments & Corrections

JavaVMMBS.ToReflectedMethod(TheClass as JavaClassMBS, methodID as JavaMethodMBS, isStatic as boolean) as JavaObjectMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Creates a new reflected method object for the given method.

Feedback, Comments & Corrections

JavaVMMBS.Version as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Java MBS Java Plugin 4.3 Yes Yes Yes Yes No
Function: Returns the version of the java engine.
Notes:
Currently the plugin always uses version 1.4.

Returns the major version number in the higher 16 bits and the minor version number in the lower 16 bits.

In JDK1.1, GetVersion() returns 0x00010001.

Feedback, Comments & Corrections

Previous items

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




Links
MBS Xojo Plugins