![]() |
Rhino ExamplesSample ScriptsThe unique.js script allows printing unique lines from a file.The liveConnect.js script shows a sample usage of LiveConnect (Java-to-JavaScript connectivity). The jsdoc.js script is a JavaScript analog to Java's javadoc. It makes heavy use of regular expressions. The checkParam.js script is a useful tool to check that @param tags in Java documentation comments match the parameters in the corresponding Java method. The enum.js script is a good example of using a JavaAdapter to implement a Java interface using a JavaScript object. The RhinoMeat.js
script is an elaborate example using Swing and networking code to download
news and display it.
Controlling the JavaScript EngineThe RunScript classRunScript.java is a simple program that executes a script from the command line.The Control classControl.java is a program that executes a simple script and then manipulates the result.JavaScript ShellShell.java is a program that executes JavaScript programs; it is a simplified version of the shell in the tools package. The programs may be specified as files on the command line or by typing interactively while the shell is running.Implementing Host ObjectsThe Foo class - Extending ScriptableObjectFoo.java is a simple JavaScript host object that includes a property with an associated action and a variable argument method.The Matrix class - Implementing ScriptableMatrix.java provides a simple multidimensional array by implementing the Scriptable interface.The File class - An advanced exampleFile.java extends ScriptableObject to provide a means of reading and writing files from JavaScript. A more involved example of host object definition.
back to top |
|||||||
| Copyright © 1998-1999 The Mozilla Organization. | |||||||