2006-11-10 15:27:40 +00:00

170 lines
7.0 KiB
HTML

<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Rhino code, released May 6, 1999.
-
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1997-1999
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-
- Alternatively, the contents of this file may be used under the terms of
- the GNU General Public License Version 2 or later (the "GPL"), in which
- case the provisions of the GPL are applicable instead of those above. If
- you wish to allow use of your version of this file only under the terms of
- the GPL and not to allow others to use your version of this file under the
- MPL, indicate your decision by deleting the provisions above and replacing
- them with the notice and other provisions required by the GPL. If you do
- not delete the provisions above, a recipient may use your version of this
- file under either the MPL or the GPL.
-
- ***** END LICENSE BLOCK ***** -->
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Norris Boyd">
<meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
<title>JavaScript API</title>
</head>
<body bgcolor="#FFFFFF">
<h1 align="center">
Rhino API Reference.</h1>
<h4>
The Control API</h4>
These APIs provide methods for controlling the actions of JavaScript in
a host environment.
<ul>
<li>
<a href="org/mozilla/javascript/Context.html">Context</a> - Represents
the runtime context of an executing script. Has methods to associate the
JavaScript evaluation engine with a Java thread, set attributes of the
engine, and compile and evaluate scripts.</li>
<li>
<a href="org/mozilla/javascript/ContextFactory.html">ContextFactory</a>
- Allows embeddings to customize creation of Context instances and monitor entering and releasing of Contexts. </li>
<li>
<a href="org/mozilla/javascript/Script.html">Script</a> - The result of
compiling a JavaScript script. Also encapsulates script execution.</li>
<li>
<a href="org/mozilla/javascript/ErrorReporter.html">ErrorReporter</a> -
This interface can be implemented to control the actions the JavaScript
engine takes when it encounters errors.</li>
<li>
<a href="org/mozilla/javascript/SecurityController.html">SecurityController</a>
- Optional support routines that must be provided by embeddings implementing
security controls on scripts.</li>
<li>
<a href="org/mozilla/javascript/ClassShutter.html">ClassShutter</a>
- Embeddings that wish to filter Java classes that are visible to scripts
through the LiveConnect, should implement this interface.</li>
<li>
<a href="org/mozilla/javascript/Wrapper.html">Wrapper</a> - Interface implemented
by objects wrapping other objects. Provides a method for recovering the
wrapped value.</li>
<li>
<a href="org/mozilla/javascript/WrapFactory.html">WrapFactory</a> - Class
embedders can extend in order to control the way Java objects are wrapped
for use by JavaScript.</li>
<li>
<a href="org/mozilla/javascript/optimizer/ClassCompiler.html">ClassCompiler</a> - Class that provies API for compiling scripts into JVM class files.</li>
<li>
<a href="org/mozilla/javascript/serialize/ScriptableOutputStream.html">ScriptableOutputStream</a> - This stream can be used to serialize JavaScript objects and functions.
</li>
<li>
<a href="org/mozilla/javascript/serialize/ScriptableInputStream.html">ScriptableInputStream</a> - This stream can be used to deserialize JavaScript objects and functions.
</li>
</ul>
<h4>
The Host Object API</h4>
These APIs provide support for adding objects specific to a particular
embedding of JavaScript in a host environment. Note that if you just want
to script existing Java classes, you should just use <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:LiveConnect_Overview">LiveConnect</a>. See also <a href="http://www.mozilla.org/js/liveconnect/">LiveConnect 3.0 specs</a>.
It is also helpful to understand some of the implementation of the <a href="runtime.html">runtime</a>.
<ul>
<li>
<a href="org/mozilla/javascript/Scriptable.html">Scriptable</a> - All JavaScript
objects must implement this interface. Provides methods to access properties
and attributes of those properties, as well as other services required
of JavaScript objects.</li>
<li>
<a href="org/mozilla/javascript/Function.html">Function</a> - All JavaScript
functions must implement this interface. Extends Scriptable, adding methods
to support invocation.</li>
<li>
<a href="org/mozilla/javascript/ScriptableObject.html">ScriptableObject</a>
- A default implementation of Scriptable that may be extended. Implements
property and attribute storage and lookup and other default JavaScript
object behavior.</li>
<li>
<a href="org/mozilla/javascript/FunctionObject.html">FunctionObject</a>
- An implementation of Function that allows Java methods and constructors
to be used as JavaScript function objects.</li>
<li>
<a href="org/mozilla/javascript/ImporterTopLevel.html">ImporterTopLevel</a>
- Allows embeddings to use the JavaImporter constructor.</li>
</ul>
<h4>
Exceptions</h4>
These exceptions are thrown by JavaScript.
<ul>
<li>
<a href="org/mozilla/javascript/RhinoException.html">RhinoException</a>
- Common root for all exception explicitly thrown by Rhino engine.</li>
<a href="org/mozilla/javascript/JavaScriptException.html">JavaScriptException</a>
- Thrown from within JavaScript by the JavaScript 'throw' statement. It wrapps the JavaScript value from 'throw' statement.</li>
<li>
<a href="org/mozilla/javascript/WrappedException.html">EcmaError</a>
- Thrown by Rhino runtime when particular runtime operation a scripts tries to execute is not allowed. The exception is thrown, for example, when a script attempts to check properties of <tt>undefined</tt>or <tt>null</tt> or refer to a name that can not be found in the current scope chain.</li>
<li>
<a href="org/mozilla/javascript/WrappedException.html">WrappedException</a>
- Thrown by LiveConnect implementation from JavaScript when called Java method exits with an exception. It wraps the original Java exception.</li>
<li>
<a href="org/mozilla/javascript/EvaluatorException.html">EvaluatorException</a>
- An exception thrown when an error is detected during the compilation or execution of
a script. The default error reporter will throw EvaluatorExceptions when
an error is encountered.</li>
</ul>
<hr WIDTH="100%">
<br><a href="overview-summary.html">back to top</a>
</body>
</html>