Search completed in 1.09 seconds.
7 results for "JavaObject":
JavaObject - Archive of obsolete content
in addition, you can explicitly construct a
javaobject using the object's java constructor with the packages keyword: new packages.javaclass(parameterlist) javaclassis the fully-specified name of the object's java class.
... description the
javaobject object is an instance of a java class that is created in or passed to javascript.
...
javaobject is a wrapper for the instance; all references to the class instance are made through the
javaobject.
...And 4 more matches
LiveConnect Overview - Archive of obsolete content
javaobject a wrapped java object, accessed from within javascript code.
...for example, you can create a java string object and assign it to the javascript variable mystring by using the new operator with the java constructor, as follows: var mystring = new java.lang.string("hello world"); in the previous example, the variable mystring is a
javaobject because it holds an instance of the java object string.
... as a
javaobject, mystring has access to the public instance methods of java.lang.string and its superclass, java.lang.object.
...And 4 more matches
JavaClass - Archive of obsolete content
example in the following example, the javaclass object java.lang.string is passed as an argument to the newinstance method which creates an array: var cars = java.lang.reflect.array.newinstance(java.lang.string, 15); see also javaarray,
javaobject, javapackage, packages ...
Rhino requirements and limitations
limitations liveconnect if a
javaobject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod; javaobj.fieldandmethod = 7; // now, field == 7 you can work around this by forcing the field value to be converted to a javascript type when you take its value: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod + 0; // force c...
Scripting Java
we can use that syntax here in combination with a function expression to define a javascript object with a run method: js> obj = { run: function () { print("\nrunning"); } } [object object] js> obj.run() running now we can create an object implementing the runnable interface by constructing a runnable: js> r = new java.lang.runnable(obj); [object
javaobject] in java it is not possible to use the new operator on an interface because there is no implementation available.