~ubuntu-branches/ubuntu/karmic/rhino/karmic

« back to all changes in this revision

Viewing changes to docs/api.html

  • Committer: Bazaar Package Importer
  • Author(s): Jerry Haltom
  • Date: 2005-03-19 16:56:07 UTC
  • mto: (11.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050319165607-geu3j3fnqlkpqkh1
Tags: upstream-1.6.R1
ImportĀ upstreamĀ versionĀ 1.6.R1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
 
<html>
3
 
<head>
4
 
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
 
   <meta name="Author" content="Norris Boyd">
6
 
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
7
 
   <title>JavaScript API</title>
8
 
</head>
9
 
<body bgcolor="#FFFFFF">
10
 
 
11
 
<center>
12
 
<h1>
13
 
Rhino API Reference.</h1></center>
14
 
 
15
 
<h4>
16
 
The Control API</h4>
17
 
These APIs provide methods for controlling the actions of JavaScript in
18
 
a host environment.
19
 
<ul>
20
 
<li>
21
 
<a href="org/mozilla/javascript/Context.html">Context</a> - Represents
22
 
the runtime context of an executing script. Has methods to associate the
23
 
JavaScript evaluation engine with a Java thread, set attributes of the
24
 
engine, and compile and evaluate scripts.</li>
25
 
 
26
 
<li>
27
 
<a href="org/mozilla/javascript/ContextListener.html">ContextListener</a> 
28
 
- Allows embeddings to be notified of the creation, entering, exiting,
29
 
and releasing of Contexts. </li>
30
 
 
31
 
<li>
32
 
<a href="org/mozilla/javascript/Script.html">Script</a> - The result of
33
 
compiling a JavaScript script. Also encapsulates script execution.</li>
34
 
 
35
 
<li>
36
 
<a href="org/mozilla/javascript/ErrorReporter.html">ErrorReporter</a> -
37
 
This interface can be implemented to control the actions the JavaScript
38
 
engine takes when it encounters errors.</li>
39
 
 
40
 
<li>
41
 
<a href="org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
42
 
- Optional support routines that must be provided by embeddings implementing
43
 
security controls on scripts.</li>
44
 
 
45
 
<li>
46
 
<a href="org/mozilla/javascript/Wrapper.html">Wrapper</a> - Interface implemented
47
 
by objects wrapping other objects. Provides a method for recovering the
48
 
wrapped value.</li>
49
 
 
50
 
<li>
51
 
<a href="org/mozilla/javascript/WrapHandler.html">WrapHandler</a> - Interface
52
 
embedders can implement in order to control the way Java objects are wrapped
53
 
for use by JavaScript.</li>
54
 
 
55
 
<li>
56
 
<a href="org/mozilla/javascript/ClassOutput.html">ClassOutput</a> - Interface
57
 
embedders can implement in order to control the placement of generated
58
 
class bytecodes.</li>
59
 
</ul>
60
 
 
61
 
<h4>
62
 
The Host Object API</h4>
63
 
These APIs provide support for adding objects specific to a particular
64
 
embedding of JavaScript in a host environment. Note that if you just want
65
 
to script existing Java classes, you should just use <a href="http://developer.netscape.com/library/documentation/communicator/jsguide4/livecon.htm">LiveConnect</a>.
66
 
It is also helpful to understand some of the implementation of the <a href="runtime.html">runtime</a>.
67
 
<ul>
68
 
<li>
69
 
<a href="org/mozilla/javascript/Scriptable.html">Scriptable</a> - All JavaScript
70
 
objects must implement this interface. Provides methods to access properties
71
 
and attributes of those properties, as well as other services required
72
 
of JavaScript objects.</li>
73
 
 
74
 
<li>
75
 
<a href="org/mozilla/javascript/Function.html">Function</a> - All JavaScript
76
 
functions must implement this interface. Extends Scriptable, adding methods
77
 
to support invocation.</li>
78
 
 
79
 
<li>
80
 
<a href="org/mozilla/javascript/ScriptableObject.html">ScriptableObject</a>
81
 
- A default implementation of Scriptable that may be extended. Implements
82
 
property and attribute storage and lookup and other default JavaScript
83
 
object behavior.</li>
84
 
 
85
 
<li>
86
 
<a href="org/mozilla/javascript/FunctionObject.html">FunctionObject</a>
87
 
- An implementation of Function that allows Java methods and constructors
88
 
to be used as JavaScript function objects.</li>
89
 
 
90
 
<li>
91
 
<a href="org/mozilla/javascript/ImporterTopLevel.html">ImporterTopLevel</a>
92
 
- Allows embeddings to use the importClass and importPackage functions.</li>
93
 
</ul>
94
 
 
95
 
<h4>
96
 
Exceptions</h4>
97
 
These exceptions are thrown by JavaScript.
98
 
<ul>
99
 
<li>
100
 
<a href="org/mozilla/javascript/JavaScriptException.html">JavaScriptException</a>
101
 
- Thrown from within JavaScript by the JavaScript 'throw' statement, or
102
 
by LiveConnect calls from JavaScript into Java. Wraps a JavaScript value.</li>
103
 
 
104
 
<li>
105
 
<a href="org/mozilla/javascript/ClassDefinitionException.html">ClassDefinitionException</a>
106
 
- Thrown if errors are detected while attempting to define a host object
107
 
from a Java class.</li>
108
 
 
109
 
<li>
110
 
<a href="org/mozilla/javascript/PropertyException.html">PropertyException</a>
111
 
- Thrown if errors are detected while attempting to define a property of
112
 
a host object from a Java class or method, or if a property is not found.</li>
113
 
 
114
 
<li>
115
 
<a href="org/mozilla/javascript/NotAFunctionException.html">NotAFunctionException</a>
116
 
- Thrown when attempting to call an object that is not a function.</li>
117
 
 
118
 
<li>
119
 
<a href="org/mozilla/javascript/EvaluatorException.html">EvaluatorException</a>
120
 
- An exception thrown when an error is detected during the execution of
121
 
a script. The default error reporter will throw EvaluatorExceptions when
122
 
an error is encountered.</li>
123
 
</ul>
124
 
 
125
 
<hr WIDTH="100%">
126
 
<br><a href="overview-summary.html">back to top</a>
127
 
</body>
128
 
</html>
 
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 
2
<html>
 
3
<head>
 
4
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
5
   <meta name="Author" content="Norris Boyd">
 
6
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
 
7
   <title>JavaScript API</title>
 
8
</head>
 
9
<body bgcolor="#FFFFFF">
 
10
 
 
11
 
 
12
<h1 align="center">
 
13
Rhino API Reference.</h1>
 
14
 
 
15
<h4>
 
16
The Control API</h4>
 
17
These APIs provide methods for controlling the actions of JavaScript in
 
18
a host environment.
 
19
<ul>
 
20
<li>
 
21
<a href="org/mozilla/javascript/Context.html">Context</a> - Represents
 
22
the runtime context of an executing script. Has methods to associate the
 
23
JavaScript evaluation engine with a Java thread, set attributes of the
 
24
engine, and compile and evaluate scripts.</li>
 
25
 
 
26
<li>
 
27
<a href="org/mozilla/javascript/ContextFactory.html">ContextFactory</a> 
 
28
- Allows embeddings to customize creation of Context instances and monitor entering and releasing of Contexts. </li>
 
29
 
 
30
<li>
 
31
<a href="org/mozilla/javascript/Script.html">Script</a> - The result of
 
32
compiling a JavaScript script. Also encapsulates script execution.</li>
 
33
 
 
34
<li>
 
35
<a href="org/mozilla/javascript/ErrorReporter.html">ErrorReporter</a> -
 
36
This interface can be implemented to control the actions the JavaScript
 
37
engine takes when it encounters errors.</li>
 
38
 
 
39
<li>
 
40
<a href="org/mozilla/javascript/SecurityController.html">SecurityController</a>
 
41
- Optional support routines that must be provided by embeddings implementing
 
42
security controls on scripts.</li>
 
43
 
 
44
<li>
 
45
<a href="org/mozilla/javascript/ClassShutter.html">ClassShutter</a>
 
46
- Embeddings that wish to filter Java classes that are visible to scripts
 
47
through the LiveConnect, should implement this interface.</li>
 
48
 
 
49
<li>
 
50
<a href="org/mozilla/javascript/Wrapper.html">Wrapper</a> - Interface implemented
 
51
by objects wrapping other objects. Provides a method for recovering the
 
52
wrapped value.</li>
 
53
 
 
54
<li>
 
55
<a href="org/mozilla/javascript/WrapFactory.html">WrapFactory</a> - Class 
 
56
embedders can extend in order to control the way Java objects are wrapped
 
57
for use by JavaScript.</li>
 
58
 
 
59
<li>
 
60
<a href="org/mozilla/javascript/optimizer/ClassCompiler.html">ClassCompiler</a> - Class that provies API for compiling scripts into JVM class files.</li>
 
61
 
 
62
<li>
 
63
<a href="org/mozilla/javascript/serialize/ScriptableOutputStream.html">ScriptableOutputStream</a> - This stream can be used to serialize JavaScript objects and functions.
 
64
</li>
 
65
 
 
66
<li>
 
67
<a href="org/mozilla/javascript/serialize/ScriptableInputStream.html">ScriptableInputStream</a> - This stream can be used to deserialize JavaScript objects and functions.
 
68
</li>
 
69
 
 
70
</ul>
 
71
 
 
72
<h4>
 
73
The Host Object API</h4>
 
74
These APIs provide support for adding objects specific to a particular
 
75
embedding of JavaScript in a host environment. Note that if you just want
 
76
to script existing Java classes, you should just use <a href="http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/lc.html">LiveConnect</a>. See also <a href="http://www.mozilla.org/js/liveconnect/">LiveConnect 3.0 specs</a>.
 
77
It is also helpful to understand some of the implementation of the <a href="runtime.html">runtime</a>.
 
78
<ul>
 
79
<li>
 
80
<a href="org/mozilla/javascript/Scriptable.html">Scriptable</a> - All JavaScript
 
81
objects must implement this interface. Provides methods to access properties
 
82
and attributes of those properties, as well as other services required
 
83
of JavaScript objects.</li>
 
84
 
 
85
<li>
 
86
<a href="org/mozilla/javascript/Function.html">Function</a> - All JavaScript
 
87
functions must implement this interface. Extends Scriptable, adding methods
 
88
to support invocation.</li>
 
89
 
 
90
<li>
 
91
<a href="org/mozilla/javascript/ScriptableObject.html">ScriptableObject</a>
 
92
- A default implementation of Scriptable that may be extended. Implements
 
93
property and attribute storage and lookup and other default JavaScript
 
94
object behavior.</li>
 
95
 
 
96
<li>
 
97
<a href="org/mozilla/javascript/FunctionObject.html">FunctionObject</a>
 
98
- An implementation of Function that allows Java methods and constructors
 
99
to be used as JavaScript function objects.</li>
 
100
 
 
101
<li>
 
102
<a href="org/mozilla/javascript/ImporterTopLevel.html">ImporterTopLevel</a>
 
103
- Allows embeddings to use the JavaImporter constructor.</li>
 
104
</ul>
 
105
 
 
106
<h4>
 
107
Exceptions</h4>
 
108
These exceptions are thrown by JavaScript.
 
109
<ul>
 
110
<li>
 
111
<a href="org/mozilla/javascript/RhinoException.html">RhinoException</a>
 
112
- Common root for all exception explicitly thrown by Rhino engine.</li>
 
113
 
 
114
<a href="org/mozilla/javascript/JavaScriptException.html">JavaScriptException</a>
 
115
- Thrown from within JavaScript by the JavaScript 'throw' statement. It wrapps the JavaScript value from 'throw' statement.</li>
 
116
 
 
117
<li>
 
118
<a href="org/mozilla/javascript/WrappedException.html">EcmaError</a>
 
119
- 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>
 
120
 
 
121
<li>
 
122
<a href="org/mozilla/javascript/WrappedException.html">WrappedException</a>
 
123
- Thrown by LiveConnect implementation from JavaScript when called Java method exits with an exception. It wraps the original Java exception.</li>
 
124
 
 
125
<li>
 
126
<a href="org/mozilla/javascript/EvaluatorException.html">EvaluatorException</a>
 
127
- An exception thrown when an error is detected during the compilation or execution of
 
128
a script. The default error reporter will throw EvaluatorExceptions when
 
129
an error is encountered.</li>
 
130
</ul>
 
131
 
 
132
<hr WIDTH="100%">
 
133
<br><a href="overview-summary.html">back to top</a>
 
134
</body>
 
135
</html>