Search completed in 1.68 seconds.
6 results for "JavaPackage":
JavaPackage - Archive of obsolete content
ArchiveWebLiveConnect ReferenceJavaPackage
created by a reference to the package name used with the packages keyword: packages.javapackage javapackageis the name of the object's java package.
... in javascript, a javapackage is a reference to a java package.
... for example, a reference to netscape is a javapackage.
...And 5 more matches
LiveConnect Overview - Archive of obsolete content
ArchiveWebLiveConnectLiveConnect Overview
javapackage a javascript reference to a java package.
...package and class references simple references to java packages and classes from javascript create the javapackage and javaclass objects.
... in the earlier example about the redwood corporation, for example, the reference packages.redwood is a javapackage object.
...most of the time, you don't have to worry about the javapackage and javaclass objects—you just work with java packages and classes, and liveconnect creates these objects transparently.
Scripting Java
MozillaProjectsRhinoScripting Java
for example, we can access the value of the java package: js> packages.java [javapackage java] as a handy shortcut, rhino defines a top-level variable java that is equivalent to packages.java.
... so the previous example could be even shorter: js> java [javapackage java] we can access java classes simply by stepping down the package hierarchy: js> java.io.file [javaclass java.io.file] if your scripts access a lot of different java classes, it can get awkward to use the full package name of the class every time.
...if that load fails, it assumes that java.myclass is a package name, and no error is reported: js> java.myclass [javapackage java.myclass] only if you attempt to use this object as a class will an error be reported.
...using a fully qualified name, the above example would look as follows: $ java org.mozilla.javascript.tools.shell.main js> jspackage = packages.org.mozilla.javascript; [javapackage org.mozilla.javascript] js> jspackage.context.currentcontext; org.mozilla.javascript.context@bb6ab6 alternatively, if you want to import just one class from a package you can do so using the importclass() method.
JavaClass - Archive of obsolete content
ArchiveWebLiveConnect ReferenceJavaClass
a javapackage object is a reference to a java package, such as netscape.javascript.
... in javascript, the javapackage and javaclass hierarchy reflect the java package and class hierarchy.
... 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 ...
LiveConnect Reference - Archive of obsolete content
ArchiveWebLiveConnectLiveConnect Reference
java-to-javascript global objects java packages netscape sun javaarray javaclass javaobject javapackage ...
JavaObject - Archive of obsolete content
ArchiveWebLiveConnect ReferenceJavaObject
var thestring = new java.lang.string("hello, world"); thestring.getclass(); // returns java.lang.string see also javaarray, javaclass, javapackage, packages ...