Java:{ from: any; isJavaObject: any; isType: any; to: any; type: any; typeName: any }
Type declaration
from: function
from(value: any): any
The from function creates a shallow copy of the Java datastructure (Array, List) as a JavaScript array.
In many cases, this is not necessary, you can typically use the Java datastructure directly
from JavaScript.
Parameters
value: any
Returns any
isJavaObject: function
isJavaObject(obj: any): boolean
The isJavaObject method returns whether obj is an object of the Java language.
It returns false for native JavaScript objects, as well as for objects of other polyglot languages.
Parameters
obj: any
Returns boolean
isType: function
isType(obj: any): boolean
The isType method returns whether obj is an object of the Java language,
representing a Java Class instance. It returns false for all other arguments.
Parameters
obj: any
Returns boolean
to: function
to(jsValue: any, javaType: any): any
The to function converts the argument to a Java dataype.
When no toType is provided, Object[] is assumed.
Parameters
jsValue: any
javaType: any
Returns any
type: function
type(className: string): any
The type function loads the specified Java class and provides it as an object.
Fields of this object can be read directly from it, and new instances can be created with the
JavaScript new keyword.
Parameters
className: string
Returns any
typeName: function
typeName(obj: any): string | undefined
The typeName method returns the Java Class name of obj. obj is expected to represent
a Java Class instance, i.e., isType(obj) should return true; otherwise, undefined is returned.
The from function creates a shallow copy of the Java datastructure (Array, List) as a JavaScript array.
In many cases, this is not necessary, you can typically use the Java datastructure directly from JavaScript.