From d7c5ad7d6263fd1baf9bfdbaa4c50b70ef2fbdb2 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 8 Jun 2010 08:22:05 +0200 Subject: reverted folder structure change for better mergeing with upstream --- .../javadoc/org/mozilla/javascript/Callable.html | 224 ++ .../javadoc/org/mozilla/javascript/ClassCache.html | 445 +++ .../org/mozilla/javascript/ClassShutter.html | 247 ++ .../org/mozilla/javascript/CompilerEnvirons.html | 669 ++++ .../javadoc/org/mozilla/javascript/Context.html | 3581 ++++++++++++++++++++ .../org/mozilla/javascript/ContextAction.html | 214 ++ .../javascript/ContextFactory.Listener.html | 236 ++ .../org/mozilla/javascript/ContextFactory.html | 935 +++++ .../javadoc/org/mozilla/javascript/EcmaError.html | 455 +++ .../org/mozilla/javascript/ErrorReporter.html | 299 ++ .../org/mozilla/javascript/EvaluatorException.html | 405 +++ .../javadoc/org/mozilla/javascript/Function.html | 297 ++ .../org/mozilla/javascript/FunctionObject.html | 774 +++++ .../mozilla/javascript/GeneratedClassLoader.html | 236 ++ .../org/mozilla/javascript/ImporterTopLevel.html | 583 ++++ .../mozilla/javascript/JavaScriptException.html | 375 ++ .../org/mozilla/javascript/RefCallable.html | 233 ++ .../org/mozilla/javascript/RhinoException.html | 544 +++ .../javadoc/org/mozilla/javascript/Script.html | 231 ++ .../javadoc/org/mozilla/javascript/Scriptable.html | 756 +++++ .../org/mozilla/javascript/ScriptableObject.html | 2604 ++++++++++++++ .../org/mozilla/javascript/SecurityController.html | 507 +++ .../org/mozilla/javascript/Synchronizer.html | 331 ++ .../org/mozilla/javascript/WrapFactory.html | 400 +++ .../org/mozilla/javascript/WrappedException.html | 323 ++ .../javadoc/org/mozilla/javascript/Wrapper.html | 214 ++ .../mozilla/javascript/debug/DebuggableScript.html | 455 +++ .../mozilla/javascript/debug/package-frame.html | 32 + .../mozilla/javascript/debug/package-summary.html | 156 + .../org/mozilla/javascript/debug/package-tree.html | 149 + .../javascript/optimizer/ClassCompiler.html | 461 +++ .../javascript/optimizer/package-frame.html | 32 + .../javascript/optimizer/package-summary.html | 155 + .../mozilla/javascript/optimizer/package-tree.html | 151 + .../org/mozilla/javascript/package-frame.html | 100 + .../org/mozilla/javascript/package-summary.html | 294 ++ .../org/mozilla/javascript/package-tree.html | 185 + .../serialize/ScriptableInputStream.html | 373 ++ .../serialize/ScriptableOutputStream.html | 458 +++ .../javascript/serialize/package-frame.html | 34 + .../javascript/serialize/package-summary.html | 161 + .../mozilla/javascript/serialize/package-tree.html | 163 + 42 files changed, 19477 insertions(+) create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html create mode 100644 trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html (limited to 'trunk/infrastructure/rhino1_7R1/javadoc/org') diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html new file mode 100644 index 0000000..07c38c5 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Callable.html @@ -0,0 +1,224 @@ + + + + + + +Callable (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface Callable

+
+
All Known Subinterfaces:
Function, RefCallable
+
+
+
All Known Implementing Classes:
org.mozilla.javascript.BaseFunction, org.mozilla.javascript.Delegator, FunctionObject, Synchronizer
+
+
+
+
public interface Callable
+ + +

+Generic notion of callable object that can execute some script-related code + upon request with specified values for script scope and this objects. +

+ +

+


+ +

+ + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectcall(Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Perform the call.
+  +

+ + + + + + + + +
+Method Detail
+ +

+call

+
+java.lang.Object call(Context cx,
+                      Scriptable scope,
+                      Scriptable thisObj,
+                      java.lang.Object[] args)
+
+
Perform the call. +

+

+
Parameters:
cx - the current Context for this thread
scope - the scope to use to resolve properties.
thisObj - the JavaScript this object
args - the array of arguments +
Returns:
the result of the call
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html new file mode 100644 index 0000000..8d8b3ef --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassCache.html @@ -0,0 +1,445 @@ + + + + + + +ClassCache (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class ClassCache

+
+java.lang.Object
+  extended by org.mozilla.javascript.ClassCache
+
+
+
+
public class ClassCache
extends java.lang.Object
+ + +

+Cache of generated classes and data structures to access Java runtime + from JavaScript. +

+ +

+

+
Since:
+
Rhino 1.5 Release 5
+
Author:
+
Igor Bukanov
+
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
ClassCache() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanassociate(ScriptableObject topScope) + +
+          Associate ClassCache object with the given top-level scope.
+ voidclearCaches() + +
+          Empty caches of generated Java classes and Java reflection information.
+static ClassCacheget(Scriptable scope) + +
+          Search for ClassCache object in the given scope.
+ booleanisCachingEnabled() + +
+          Check if generated Java classes and Java reflection information + is cached.
+ booleanisInvokerOptimizationEnabled() + +
+          Deprecated. The method always returns false.
+ intnewClassSerialNumber() + +
+          Internal engine method to return serial number for generated classes + to ensure name uniqueness.
+ voidsetCachingEnabled(boolean enabled) + +
+          Set whether to cache some values.
+ voidsetInvokerOptimizationEnabled(boolean enabled) + +
+          Deprecated. The method does nothing. + Invoker optimization is no longer used by Rhino. + On modern JDK like 1.4 or 1.5 the disadvantages of the optimization + like increased memory usage or longer initialization time overweight + small speed increase that can be gained using generated proxy class + to replace reflection.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ClassCache

+
+public ClassCache()
+
+
+ + + + + + + + +
+Method Detail
+ +

+get

+
+public static ClassCache get(Scriptable scope)
+
+
Search for ClassCache object in the given scope. + The method first calls + ScriptableObject.getTopLevelScope(Scriptable scope) + to get the top most scope and then tries to locate associated + ClassCache object in the prototype chain of the top scope. +

+

+
Parameters:
scope - scope to search for ClassCache object. +
Returns:
previously associated ClassCache object or a new instance of + ClassCache if no ClassCache object was found.
See Also:
associate(ScriptableObject topScope)
+
+
+
+ +

+associate

+
+public boolean associate(ScriptableObject topScope)
+
+
Associate ClassCache object with the given top-level scope. + The ClassCache object can only be associated with the given scope once. +

+

+
Parameters:
topScope - scope to associate this ClassCache object with. +
Returns:
true if no previous ClassCache objects were embedded into + the scope and this ClassCache were successfully associated + or false otherwise.
See Also:
get(Scriptable scope)
+
+
+
+ +

+clearCaches

+
+public void clearCaches()
+
+
Empty caches of generated Java classes and Java reflection information. +

+

+
+
+
+
+ +

+isCachingEnabled

+
+public final boolean isCachingEnabled()
+
+
Check if generated Java classes and Java reflection information + is cached. +

+

+
+
+
+
+ +

+setCachingEnabled

+
+public void setCachingEnabled(boolean enabled)
+
+
Set whether to cache some values. +

+ By default, the engine will cache the results of + Class.getMethods() and similar calls. + This can speed execution dramatically, but increases the memory + footprint. Also, with caching enabled, references may be held to + objects past the lifetime of any real usage. +

+ If caching is enabled and this method is called with a + false argument, the caches will be emptied. +

+ Caching is enabled by default. +

+

+
Parameters:
enabled - if true, caching is enabled
See Also:
clearCaches()
+
+
+
+ +

+isInvokerOptimizationEnabled

+
+public boolean isInvokerOptimizationEnabled()
+
+
Deprecated. The method always returns false. +

+

+
See Also:
setInvokerOptimizationEnabled(boolean enabled)
+
+
+
+ +

+setInvokerOptimizationEnabled

+
+public void setInvokerOptimizationEnabled(boolean enabled)
+
+
Deprecated. The method does nothing. + Invoker optimization is no longer used by Rhino. + On modern JDK like 1.4 or 1.5 the disadvantages of the optimization + like increased memory usage or longer initialization time overweight + small speed increase that can be gained using generated proxy class + to replace reflection. +

+

+
+
+
+
+ +

+newClassSerialNumber

+
+public final int newClassSerialNumber()
+
+
Internal engine method to return serial number for generated classes + to ensure name uniqueness. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html new file mode 100644 index 0000000..924cfb5 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ClassShutter.html @@ -0,0 +1,247 @@ + + + + + + +ClassShutter (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface ClassShutter

+
+
+
public interface ClassShutter
+ + +

+Embeddings that wish to filter Java classes that are visible to scripts +through the LiveConnect, should implement this interface. +

+ +

+

+
Since:
+
1.5 Release 4
+
Author:
+
Norris Boyd
+
See Also:
Context.setClassShutter(ClassShutter)
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+ booleanvisibleToScripts(java.lang.String fullClassName) + +
+          Return true iff the Java class with the given name should be exposed + to scripts.
+  +

+ + + + + + + + +
+Method Detail
+ +

+visibleToScripts

+
+boolean visibleToScripts(java.lang.String fullClassName)
+
+
Return true iff the Java class with the given name should be exposed + to scripts. +

+ An embedding may filter which Java classes are exposed through + LiveConnect to JavaScript scripts. +

+ Due to the fact that there is no package reflection in Java, + this method will also be called with package names. There + is no way for Rhino to tell if "Packages.a.b" is a package name + or a class that doesn't exist. What Rhino does is attempt + to load each segment of "Packages.a.b.c": It first attempts to + load class "a", then attempts to load class "a.b", then + finally attempts to load class "a.b.c". On a Rhino installation + without any ClassShutter set, and without any of the + above classes, the expression "Packages.a.b.c" will result in + a [JavaPackage a.b.c] and not an error. +

+ With ClassShutter supplied, Rhino will first call + visibleToScripts before attempting to look up the class name. If + visibleToScripts returns false, the class name lookup is not + performed and subsequent Rhino execution assumes the class is + not present. So for "java.lang.System.out.println" the lookup + of "java.lang.System" is skipped and thus Rhino assumes that + "java.lang.System" doesn't exist. So then for "java.lang.System.out", + Rhino attempts to load the class "java.lang.System.out" because + it assumes that "java.lang.System" is a package name. +

+

+

+
Parameters:
fullClassName - the full name of the class (including the package + name, with '.' as a delimiter). For example the + standard string class is "java.lang.String" +
Returns:
whether or not to reveal this class to scripts
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html new file mode 100644 index 0000000..8b5e109 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/CompilerEnvirons.html @@ -0,0 +1,669 @@ + + + + + + +CompilerEnvirons (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class CompilerEnvirons

+
+java.lang.Object
+  extended by org.mozilla.javascript.CompilerEnvirons
+
+
+
+
public class CompilerEnvirons
extends java.lang.Object
+ + +

+


+ +

+ + + + + + + + + + + +
+Constructor Summary
CompilerEnvirons() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ ErrorReportergetErrorReporter() + +
+           
+ intgetLanguageVersion() + +
+           
+ intgetOptimizationLevel() + +
+           
+ voidinitFromContext(Context cx) + +
+           
+ booleanisAllowMemberExprAsFunctionName() + +
+           
+ booleanisGenerateDebugInfo() + +
+           
+ booleanisGenerateObserverCount() + +
+           
+ booleanisGeneratingSource() + +
+           
+ booleanisReservedKeywordAsIdentifier() + +
+           
+ booleanisStrictMode() + +
+           
+ booleanisUseDynamicScope() + +
+           
+ booleanisXmlAvailable() + +
+           
+ booleanreportWarningAsError() + +
+           
+ voidsetAllowMemberExprAsFunctionName(boolean flag) + +
+           
+ voidsetErrorReporter(ErrorReporter errorReporter) + +
+           
+ voidsetGenerateDebugInfo(boolean flag) + +
+           
+ voidsetGenerateObserverCount(boolean generateObserverCount) + +
+          Turn on or off generation of code with callbacks to + track the count of executed instructions.
+ voidsetGeneratingSource(boolean generatingSource) + +
+          Specify whether or not source information should be generated.
+ voidsetLanguageVersion(int languageVersion) + +
+           
+ voidsetOptimizationLevel(int level) + +
+           
+ voidsetReservedKeywordAsIdentifier(boolean flag) + +
+           
+ voidsetXmlAvailable(boolean flag) + +
+           
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+CompilerEnvirons

+
+public CompilerEnvirons()
+
+
+ + + + + + + + +
+Method Detail
+ +

+initFromContext

+
+public void initFromContext(Context cx)
+
+
+
+
+
+
+ +

+getErrorReporter

+
+public final ErrorReporter getErrorReporter()
+
+
+
+
+
+
+ +

+setErrorReporter

+
+public void setErrorReporter(ErrorReporter errorReporter)
+
+
+
+
+
+
+ +

+getLanguageVersion

+
+public final int getLanguageVersion()
+
+
+
+
+
+
+ +

+setLanguageVersion

+
+public void setLanguageVersion(int languageVersion)
+
+
+
+
+
+
+ +

+isGenerateDebugInfo

+
+public final boolean isGenerateDebugInfo()
+
+
+
+
+
+
+ +

+setGenerateDebugInfo

+
+public void setGenerateDebugInfo(boolean flag)
+
+
+
+
+
+
+ +

+isUseDynamicScope

+
+public final boolean isUseDynamicScope()
+
+
+
+
+
+
+ +

+isReservedKeywordAsIdentifier

+
+public final boolean isReservedKeywordAsIdentifier()
+
+
+
+
+
+
+ +

+setReservedKeywordAsIdentifier

+
+public void setReservedKeywordAsIdentifier(boolean flag)
+
+
+
+
+
+
+ +

+isAllowMemberExprAsFunctionName

+
+public final boolean isAllowMemberExprAsFunctionName()
+
+
+
+
+
+
+ +

+setAllowMemberExprAsFunctionName

+
+public void setAllowMemberExprAsFunctionName(boolean flag)
+
+
+
+
+
+
+ +

+isXmlAvailable

+
+public final boolean isXmlAvailable()
+
+
+
+
+
+
+ +

+setXmlAvailable

+
+public void setXmlAvailable(boolean flag)
+
+
+
+
+
+
+ +

+getOptimizationLevel

+
+public final int getOptimizationLevel()
+
+
+
+
+
+
+ +

+setOptimizationLevel

+
+public void setOptimizationLevel(int level)
+
+
+
+
+
+
+ +

+isGeneratingSource

+
+public final boolean isGeneratingSource()
+
+
+
+
+
+
+ +

+isStrictMode

+
+public final boolean isStrictMode()
+
+
+
+
+
+
+ +

+reportWarningAsError

+
+public final boolean reportWarningAsError()
+
+
+
+
+
+
+ +

+setGeneratingSource

+
+public void setGeneratingSource(boolean generatingSource)
+
+
Specify whether or not source information should be generated. +

+ Without source information, evaluating the "toString" method + on JavaScript functions produces only "[native code]" for + the body of the function. + Note that code generated without source is not fully ECMA + conformant. +

+

+
+
+
+
+ +

+isGenerateObserverCount

+
+public boolean isGenerateObserverCount()
+
+
+ +
Returns:
true iff code will be generated with callbacks to enable + instruction thresholds
+
+
+
+ +

+setGenerateObserverCount

+
+public void setGenerateObserverCount(boolean generateObserverCount)
+
+
Turn on or off generation of code with callbacks to + track the count of executed instructions. + Currently only affects JVM byte code generation: this slows down the + generated code, but code generated without the callbacks will not + be counted toward instruction thresholds. Rhino's interpretive + mode does instruction counting without inserting callbacks, so + there is no requirement to compile code differently. +

+

+
Parameters:
generateObserverCount - if true, generated code will contain + calls to accumulate an estimate of the instructions executed.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html new file mode 100644 index 0000000..64fb637 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Context.html @@ -0,0 +1,3581 @@ + + + + + + +Context (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class Context

+
+java.lang.Object
+  extended by org.mozilla.javascript.Context
+
+
+
+
public class Context
extends java.lang.Object
+ + +

+This class represents the runtime context of an executing script. + + Before executing a script, an instance of Context must be created + and associated with the thread that will be executing the script. + The Context will be used to store information about the executing + of the script such as the call stack. Contexts are associated with + the current thread using the call(ContextAction) + or enter() methods.

+ + Different forms of script execution are supported. Scripts may be + evaluated from the source directly, or first compiled and then later + executed. Interactive execution is also supported.

+ + Some aspects of script execution, such as type conversions and + object creation, may be accessed directly through methods of + Context. +

+ +

+

+
Author:
+
Norris Boyd, Brendan Eich
+
See Also:
Scriptable
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static java.lang.Object[]emptyArgs + +
+          Convenient value to use as zero-length array of objects.
+static java.lang.StringerrorReporterProperty + +
+           
+static intFEATURE_DYNAMIC_SCOPE + +
+          Control if dynamic scope should be used for name access.
+static intFEATURE_E4X + +
+          Control if support for E4X(ECMAScript for XML) extension is available.
+static intFEATURE_ENHANCED_JAVA_ACCESS + +
+          Enables enhanced access to Java.
+static intFEATURE_LOCATION_INFORMATION_IN_ERROR + +
+          When the feature is on Rhino will add a "fileName" and "lineNumber" + properties to Error objects automatically.
+static intFEATURE_MEMBER_EXPR_AS_FUNCTION_NAME + +
+          Control if member expression as function name extension is available.
+static intFEATURE_NON_ECMA_GET_YEAR + +
+          Controls behaviour of Date.prototype.getYear().
+static intFEATURE_PARENT_PROTO_PROPERTIES + +
+          Control if properties __proto__ and __parent__ + are treated specially.
+static intFEATURE_PARENT_PROTO_PROPRTIES + +
+          Deprecated. In previous releases, this name was given to + FEATURE_PARENT_PROTO_PROPERTIES.
+static intFEATURE_RESERVED_KEYWORD_AS_IDENTIFIER + +
+          Control if reserved keywords are treated as identifiers.
+static intFEATURE_STRICT_EVAL + +
+          Control if strict eval mode is enabled.
+static intFEATURE_STRICT_MODE + +
+          Controls whether JS 1.5 'strict mode' is enabled.
+static intFEATURE_STRICT_VARS + +
+          Control if strict variable mode is enabled.
+static intFEATURE_TO_STRING_AS_SOURCE + +
+          Control if toString() should returns the same result + as toSource() when applied to objects and arrays.
+static intFEATURE_WARNING_AS_ERROR + +
+          Controls whether a warning should be treated as an error.
+ booleangenerateObserverCount + +
+           
+static java.lang.StringlanguageVersionProperty + +
+           
+static intVERSION_1_0 + +
+          JavaScript 1.0
+static intVERSION_1_1 + +
+          JavaScript 1.1
+static intVERSION_1_2 + +
+          JavaScript 1.2
+static intVERSION_1_3 + +
+          JavaScript 1.3
+static intVERSION_1_4 + +
+          JavaScript 1.4
+static intVERSION_1_5 + +
+          JavaScript 1.5
+static intVERSION_1_6 + +
+          JavaScript 1.6
+static intVERSION_1_7 + +
+          JavaScript 1.7
+static intVERSION_DEFAULT + +
+          The default version.
+static intVERSION_UNKNOWN + +
+          The unknown version.
+  + + + + + + + + + + +
+Constructor Summary
Context() + +
+          Deprecated. use ContextFactory.enter() or + ContextFactory.call(ContextAction) instead.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddActivationName(java.lang.String name) + +
+          Add a name to the list of names forcing the creation of real + activation objects for functions.
+static voidaddContextListener(org.mozilla.javascript.ContextListener listener) + +
+          Deprecated.  
+ voidaddPropertyChangeListener(java.beans.PropertyChangeListener l) + +
+          Register an object to receive notifications when a bound property + has changed
+static java.lang.Objectcall(ContextAction action) + +
+          Deprecated. use ContextFactory.call(ContextAction) instead as + this method relies on usage of a static singleton "global" + ContextFactory.
+static java.lang.Objectcall(ContextFactory factory, + Callable callable, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Call Callable.call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + using the Context instance associated with the current thread.
+static voidcheckLanguageVersion(int version) + +
+           
+static voidcheckOptimizationLevel(int optimizationLevel) + +
+           
+ FunctioncompileFunction(Scriptable scope, + java.lang.String source, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Compile a JavaScript function.
+ ScriptcompileReader(java.io.Reader in, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Compiles the source in the given reader.
+ ScriptcompileReader(Scriptable scope, + java.io.Reader in, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Deprecated.  
+ ScriptcompileString(java.lang.String source, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Compiles the source in the given string.
+ GeneratedClassLoadercreateClassLoader(java.lang.ClassLoader parent) + +
+          Create class loader for generated classes.
+ java.lang.StringdecompileFunction(Function fun, + int indent) + +
+          Decompile a JavaScript Function.
+ java.lang.StringdecompileFunctionBody(Function fun, + int indent) + +
+          Decompile the body of a JavaScript Function.
+ java.lang.StringdecompileScript(Script script, + int indent) + +
+          Decompile the script.
+static Contextenter() + +
+          Deprecated. use ContextFactory.enter() or + ContextFactory.call(ContextAction) instead as this method relies + on usage of a static singleton "global" ContextFactory.
+static Contextenter(Context cx) + +
+          Deprecated. use ContextFactory.enterContext(Context) instead as + this method relies on usage of a static singleton "global" ContextFactory.
+ java.lang.ObjectevaluateReader(Scriptable scope, + java.io.Reader in, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Evaluate a reader as JavaScript source.
+ java.lang.ObjectevaluateString(Scriptable scope, + java.lang.String source, + java.lang.String sourceName, + int lineno, + java.lang.Object securityDomain) + +
+          Evaluate a JavaScript source string.
+static voidexit() + +
+          Exit a block of code requiring a Context.
+ java.lang.ClassLoadergetApplicationClassLoader() + +
+           
+static ContextgetCurrentContext() + +
+          Get the current Context.
+static DebuggableScriptgetDebuggableView(Script script) + +
+          Return DebuggableScript instance if any associated with the script.
+ org.mozilla.javascript.debug.DebuggergetDebugger() + +
+          Return the current debugger.
+ java.lang.ObjectgetDebuggerContextData() + +
+          Return the debugger context data associated with current context.
+ org.mozilla.javascript.xml.XMLLib.FactorygetE4xImplementationFactory() + +
+          Returns an object which specifies an E4X implementation to use within + this Context.
+ java.lang.Object[]getElements(Scriptable object) + +
+          Get the elements of a JavaScript array.
+ ErrorReportergetErrorReporter() + +
+          Get the current error reporter.
+ ContextFactorygetFactory() + +
+          Return ContextFactory instance used to create this Context.
+ java.lang.StringgetImplementationVersion() + +
+          Get the implementation version.
+ intgetInstructionObserverThreshold() + +
+          Get threshold of executed instructions counter that triggers call to + observeInstructionCount().
+ intgetLanguageVersion() + +
+          Get the current language version.
+ java.util.LocalegetLocale() + +
+          Get the current locale.
+ intgetMaximumInterpreterStackDepth() + +
+          Returns the maximum stack depth (in terms of number of call frames) + allowed in a single invocation of interpreter.
+ intgetOptimizationLevel() + +
+          Get the current optimization level.
+ java.lang.ObjectgetThreadLocal(java.lang.Object key) + +
+          Get a value corresponding to a key.
+static java.lang.ObjectgetUndefinedValue() + +
+          Get the singleton object that represents the JavaScript Undefined value.
+ WrapFactorygetWrapFactory() + +
+          Return the current WrapFactory, or null if none is defined.
+ booleanhasCompileFunctionsWithDynamicScope() + +
+          Deprecated.  
+ booleanhasFeature(int featureIndex) + +
+          Controls certain aspects of script semantics.
+ ScriptableObjectinitStandardObjects() + +
+          Initialize the standard objects.
+ ScriptableinitStandardObjects(ScriptableObject scope) + +
+          Initialize the standard objects.
+ ScriptableObjectinitStandardObjects(ScriptableObject scope, + boolean sealed) + +
+          Initialize the standard objects.
+ booleanisActivationNeeded(java.lang.String name) + +
+          Check whether the name is in the list of names of objects + forcing the creation of activation objects.
+ booleanisGeneratingDebug() + +
+          Tell whether debug information is being generated.
+ booleanisGeneratingDebugChanged() + +
+           
+ booleanisGeneratingSource() + +
+          Tell whether source information is being generated.
+ booleanisSealed() + +
+          Checks if this is a sealed Context.
+static booleanisValidLanguageVersion(int version) + +
+           
+static booleanisValidOptimizationLevel(int optimizationLevel) + +
+           
+static java.lang.ObjectjavaToJS(java.lang.Object value, + Scriptable scope) + +
+          Convenient method to convert java value to its closest representation + in JavaScript.
+static java.lang.ObjectjsToJava(java.lang.Object value, + java.lang.Class desiredType) + +
+          Convert a JavaScript value into the desired type.
+ ScriptablenewArray(Scriptable scope, + int length) + +
+          Create an array with a specified initial length.
+ ScriptablenewArray(Scriptable scope, + java.lang.Object[] elements) + +
+          Create an array with a set of initial elements.
+ ScriptablenewObject(Scriptable scope) + +
+          Create a new JavaScript object.
+ ScriptablenewObject(Scriptable scope, + java.lang.String constructorName) + +
+          Create a new JavaScript object by executing the named constructor.
+ ScriptablenewObject(Scriptable scope, + java.lang.String constructorName, + java.lang.Object[] args) + +
+          Creates a new JavaScript object by executing the named constructor.
+protected  voidobserveInstructionCount(int instructionCount) + +
+          Allow application to monitor counter of executed script instructions + in Context subclasses.
+ voidputThreadLocal(java.lang.Object key, + java.lang.Object value) + +
+          Put a value that can later be retrieved using a given key.
+ voidremoveActivationName(java.lang.String name) + +
+          Remove a name from the list of names forcing the creation of real + activation objects for functions.
+static voidremoveContextListener(org.mozilla.javascript.ContextListener listener) + +
+          Deprecated.  
+ voidremovePropertyChangeListener(java.beans.PropertyChangeListener l) + +
+          Remove an object from the list of objects registered to receive + notification of changes to a bounded property
+ voidremoveThreadLocal(java.lang.Object key) + +
+          Remove values from thread-local storage.
+static voidreportError(java.lang.String message) + +
+          Report an error using the error reporter for the current thread.
+static voidreportError(java.lang.String message, + java.lang.String sourceName, + int lineno, + java.lang.String lineSource, + int lineOffset) + +
+          Report an error using the error reporter for the current thread.
+static EvaluatorExceptionreportRuntimeError(java.lang.String message) + +
+          Report a runtime error using the error reporter for the current thread.
+static EvaluatorExceptionreportRuntimeError(java.lang.String message, + java.lang.String sourceName, + int lineno, + java.lang.String lineSource, + int lineOffset) + +
+          Report a runtime error using the error reporter for the current thread.
+static voidreportWarning(java.lang.String message) + +
+          Report a warning using the error reporter for the current thread.
+static voidreportWarning(java.lang.String message, + java.lang.String sourceName, + int lineno, + java.lang.String lineSource, + int lineOffset) + +
+          Report a warning using the error reporter for the current thread.
+static voidreportWarning(java.lang.String message, + java.lang.Throwable t) + +
+           
+ voidseal(java.lang.Object sealKey) + +
+          Seal this Context object so any attempt to modify any of its properties + including calling enter() and exit() methods will + throw an exception.
+ voidsetApplicationClassLoader(java.lang.ClassLoader loader) + +
+           
+static voidsetCachingEnabled(boolean cachingEnabled) + +
+          Deprecated.  
+ voidsetClassShutter(ClassShutter shutter) + +
+          Set the LiveConnect access filter for this context.
+ voidsetCompileFunctionsWithDynamicScope(boolean flag) + +
+          Deprecated.  
+ voidsetDebugger(org.mozilla.javascript.debug.Debugger debugger, + java.lang.Object contextData) + +
+          Set the associated debugger.
+ ErrorReportersetErrorReporter(ErrorReporter reporter) + +
+          Change the current error reporter.
+ voidsetGenerateObserverCount(boolean generateObserverCount) + +
+          Turn on or off generation of code with callbacks to + track the count of executed instructions.
+ voidsetGeneratingDebug(boolean generatingDebug) + +
+          Specify whether or not debug information should be generated.
+ voidsetGeneratingSource(boolean generatingSource) + +
+          Specify whether or not source information should be generated.
+ voidsetInstructionObserverThreshold(int threshold) + +
+          Set threshold of executed instructions counter that triggers call to + observeInstructionCount().
+ voidsetLanguageVersion(int version) + +
+          Set the language version.
+ java.util.LocalesetLocale(java.util.Locale loc) + +
+          Set the current locale.
+ voidsetMaximumInterpreterStackDepth(int max) + +
+          Sets the maximum stack depth (in terms of number of call frames) + allowed in a single invocation of interpreter.
+ voidsetOptimizationLevel(int optimizationLevel) + +
+          Set the current optimization level.
+ voidsetSecurityController(SecurityController controller) + +
+          Set the security controller for this context.
+ voidsetWrapFactory(WrapFactory wrapFactory) + +
+          Set a WrapFactory for this Context.
+ booleanstringIsCompilableUnit(java.lang.String source) + +
+          Check whether a string is ready to be compiled.
+static java.lang.RuntimeExceptionthrowAsScriptRuntimeEx(java.lang.Throwable e) + +
+          Rethrow the exception wrapping it as the script runtime exception.
+static booleantoBoolean(java.lang.Object value) + +
+          Convert the value to a JavaScript boolean value.
+static doubletoNumber(java.lang.Object value) + +
+          Convert the value to a JavaScript Number value.
+static ScriptabletoObject(java.lang.Object value, + Scriptable scope) + +
+          Convert the value to an JavaScript object value.
+static ScriptabletoObject(java.lang.Object value, + Scriptable scope, + java.lang.Class staticType) + +
+          Deprecated.  
+static java.lang.StringtoString(java.lang.Object value) + +
+          Convert the value to a JavaScript String value.
+static java.lang.ObjecttoType(java.lang.Object value, + java.lang.Class desiredType) + +
+          Deprecated.  
+ voidunseal(java.lang.Object sealKey) + +
+          Unseal previously sealed Context object.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+VERSION_UNKNOWN

+
+public static final int VERSION_UNKNOWN
+
+
The unknown version. +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_DEFAULT

+
+public static final int VERSION_DEFAULT
+
+
The default version. +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_0

+
+public static final int VERSION_1_0
+
+
JavaScript 1.0 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_1

+
+public static final int VERSION_1_1
+
+
JavaScript 1.1 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_2

+
+public static final int VERSION_1_2
+
+
JavaScript 1.2 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_3

+
+public static final int VERSION_1_3
+
+
JavaScript 1.3 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_4

+
+public static final int VERSION_1_4
+
+
JavaScript 1.4 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_5

+
+public static final int VERSION_1_5
+
+
JavaScript 1.5 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_6

+
+public static final int VERSION_1_6
+
+
JavaScript 1.6 +

+

+
See Also:
Constant Field Values
+
+
+ +

+VERSION_1_7

+
+public static final int VERSION_1_7
+
+
JavaScript 1.7 +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_NON_ECMA_GET_YEAR

+
+public static final int FEATURE_NON_ECMA_GET_YEAR
+
+
Controls behaviour of Date.prototype.getYear(). + If hasFeature(FEATURE_NON_ECMA_GET_YEAR) returns true, + Date.prototype.getYear subtructs 1900 only if 1900 <= date < 2000. + The default behavior of hasFeature(int) is always to subtruct + 1900 as rquired by ECMAScript B.2.4. +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME

+
+public static final int FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME
+
+
Control if member expression as function name extension is available. + If hasFeature(FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME) returns + true, allow function memberExpression(args) { body } to be + syntax sugar for memberExpression = function(args) { body }, + when memberExpression is not a simple identifier. + See ECMAScript-262, section 11.2 for definition of memberExpression. + By default hasFeature(int) returns false. +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER

+
+public static final int FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER
+
+
Control if reserved keywords are treated as identifiers. + If hasFeature(RESERVED_KEYWORD_AS_IDENTIFIER) returns true, + treat future reserved keyword (see Ecma-262, section 7.5.3) as ordinary + identifiers but warn about this usage. + + By default hasFeature(int) returns false. +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_TO_STRING_AS_SOURCE

+
+public static final int FEATURE_TO_STRING_AS_SOURCE
+
+
Control if toString() should returns the same result + as toSource() when applied to objects and arrays. + If hasFeature(FEATURE_TO_STRING_AS_SOURCE) returns true, + calling toString() on JS objects gives the same result as + calling toSource(). That is it returns JS source with code + to create an object with all enumeratable fields of the original object + instead of printing [object result of + Scriptable.getClassName()]. +

+ By default hasFeature(int) returns true only if + the current JS version is set to VERSION_1_2. +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_PARENT_PROTO_PROPERTIES

+
+public static final int FEATURE_PARENT_PROTO_PROPERTIES
+
+
Control if properties __proto__ and __parent__ + are treated specially. + If hasFeature(FEATURE_PARENT_PROTO_PROPERTIES) returns true, + treat __parent__ and __proto__ as special properties. +

+ The properties allow to query and set scope and prototype chains for the + objects. The special meaning of the properties is available + only when they are used as the right hand side of the dot operator. + For example, while x.__proto__ = y changes the prototype + chain of the object x to point to y, + x["__proto__"] = y simply assigns a new value to the property + __proto__ in x even when the feature is on. + + By default hasFeature(int) returns true. +

+

+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_PARENT_PROTO_PROPRTIES

+
+public static final int FEATURE_PARENT_PROTO_PROPRTIES
+
+
Deprecated. In previous releases, this name was given to + FEATURE_PARENT_PROTO_PROPERTIES.
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_E4X

+
+public static final int FEATURE_E4X
+
+
Control if support for E4X(ECMAScript for XML) extension is available. + If hasFeature(FEATURE_E4X) returns true, the XML syntax is available. +

+ By default hasFeature(int) returns true if + the current JS version is set to VERSION_DEFAULT + or is at least VERSION_1_6. +

+

+
Since:
+
1.6 Release 1
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_DYNAMIC_SCOPE

+
+public static final int FEATURE_DYNAMIC_SCOPE
+
+
Control if dynamic scope should be used for name access. + If hasFeature(FEATURE_DYNAMIC_SCOPE) returns true, then the name lookup + during name resolution will use the top scope of the script or function + which is at the top of JS execution stack instead of the top scope of the + script or function from the current stack frame if the top scope of + the top stack frame contains the top scope of the current stack frame + on its prototype chain. +

+ This is useful to define shared scope containing functions that can + be called from scripts and functions using private scopes. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.6 Release 1
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_STRICT_VARS

+
+public static final int FEATURE_STRICT_VARS
+
+
Control if strict variable mode is enabled. + When the feature is on Rhino reports runtime errors if assignment + to a global variable that does not exist is executed. When the feature + is off such assignments creates new variable in the global scope as + required by ECMA 262. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.6 Release 1
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_STRICT_EVAL

+
+public static final int FEATURE_STRICT_EVAL
+
+
Control if strict eval mode is enabled. + When the feature is on Rhino reports runtime errors if non-string + argument is passed to the eval function. When the feature is off + eval simply return non-string argument as is without performing any + evaluation as required by ECMA 262. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.6 Release 1
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_LOCATION_INFORMATION_IN_ERROR

+
+public static final int FEATURE_LOCATION_INFORMATION_IN_ERROR
+
+
When the feature is on Rhino will add a "fileName" and "lineNumber" + properties to Error objects automatically. When the feature is off, you + have to explicitly pass them as the second and third argument to the + Error constructor. Note that neither behaviour is fully ECMA 262 + compliant (as 262 doesn't specify a three-arg constructor), but keeping + the feature off results in Error objects that don't have + additional non-ECMA properties when constructed using the ECMA-defined + single-arg constructor and is thus desirable if a stricter ECMA + compliance is desired, specifically adherence to the point 15.11.5. of + the standard. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.6 Release 6
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_STRICT_MODE

+
+public static final int FEATURE_STRICT_MODE
+
+
Controls whether JS 1.5 'strict mode' is enabled. + When the feature is on, Rhino reports more than a dozen different + warnings. When the feature is off, these warnings are not generated. + FEATURE_STRICT_MODE implies FEATURE_STRICT_VARS and FEATURE_STRICT_EVAL. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.6 Release 6
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_WARNING_AS_ERROR

+
+public static final int FEATURE_WARNING_AS_ERROR
+
+
Controls whether a warning should be treated as an error. +

+

+
Since:
+
1.6 Release 6
+
See Also:
Constant Field Values
+
+
+ +

+FEATURE_ENHANCED_JAVA_ACCESS

+
+public static final int FEATURE_ENHANCED_JAVA_ACCESS
+
+
Enables enhanced access to Java. + Specifically, controls whether private and protected members can be + accessed, and whether scripts can catch all Java exceptions. +

+ Note that this feature should only be enabled for trusted scripts. +

+ By default hasFeature(int) returns false. +

+

+
Since:
+
1.7 Release 1
+
See Also:
Constant Field Values
+
+
+ +

+languageVersionProperty

+
+public static final java.lang.String languageVersionProperty
+
+
+
See Also:
Constant Field Values
+
+
+ +

+errorReporterProperty

+
+public static final java.lang.String errorReporterProperty
+
+
+
See Also:
Constant Field Values
+
+
+ +

+emptyArgs

+
+public static final java.lang.Object[] emptyArgs
+
+
Convenient value to use as zero-length array of objects. +

+

+
+
+
+ +

+generateObserverCount

+
+public boolean generateObserverCount
+
+
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+Context

+
+public Context()
+
+
Deprecated. use ContextFactory.enter() or + ContextFactory.call(ContextAction) instead. +

+

Create a new Context. + + Note that the Context must be associated with a thread before + it can be used to execute a script. +

+

+ + + + + + + + +
+Method Detail
+ +

+getCurrentContext

+
+public static Context getCurrentContext()
+
+
Get the current Context. + + The current Context is per-thread; this method looks up + the Context associated with the current thread.

+

+

+ +
Returns:
the Context associated with the current thread, or + null if no context is associated with the current + thread.
See Also:
ContextFactory.enterContext(), +ContextFactory.call(ContextAction)
+
+
+
+ +

+enter

+
+public static Context enter()
+
+
Deprecated. use ContextFactory.enter() or + ContextFactory.call(ContextAction) instead as this method relies + on usage of a static singleton "global" ContextFactory. +

+

Same as calling ContextFactory.enterContext() on the global + ContextFactory instance. +

+

+ +
Returns:
a Context associated with the current thread
See Also:
getCurrentContext(), +exit(), +call(ContextAction)
+
+
+
+ +

+enter

+
+public static Context enter(Context cx)
+
+
Deprecated. use ContextFactory.enterContext(Context) instead as + this method relies on usage of a static singleton "global" ContextFactory. +

+

Get a Context associated with the current thread, using + the given Context if need be. +

+ The same as enter() except that cx + is associated with the current thread and returned if + the current thread has no associated context and cx + is not associated with any other thread. +

+

+
Parameters:
cx - a Context to associate with the thread if possible +
Returns:
a Context associated with the current thread
See Also:
ContextFactory.enterContext(Context), +ContextFactory.call(ContextAction)
+
+
+
+ +

+exit

+
+public static void exit()
+
+
Exit a block of code requiring a Context. + + Calling exit() will remove the association between + the current thread and a Context if the prior call to + ContextFactory.enterContext() on this thread newly associated a + Context with this thread. Once the current thread no longer has an + associated Context, it cannot be used to execute JavaScript until it is + again associated with a Context. +

+

+
See Also:
ContextFactory.enterContext()
+
+
+
+ +

+call

+
+public static java.lang.Object call(ContextAction action)
+
+
Deprecated. use ContextFactory.call(ContextAction) instead as + this method relies on usage of a static singleton "global" + ContextFactory. +

+

Call ContextAction.run(Context cx) + using the Context instance associated with the current thread. + If no Context is associated with the thread, then + ContextFactory.getGlobal().makeContext() will be called to + construct new Context instance. The instance will be temporary + associated with the thread during call to + ContextAction.run(Context). +

+

+ +
Returns:
The result of ContextAction.run(Context).
+
+
+
+ +

+call

+
+public static java.lang.Object call(ContextFactory factory,
+                                    Callable callable,
+                                    Scriptable scope,
+                                    Scriptable thisObj,
+                                    java.lang.Object[] args)
+
+
Call Callable.call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + using the Context instance associated with the current thread. + If no Context is associated with the thread, then + ContextFactory.makeContext() will be called to construct + new Context instance. The instance will be temporary associated + with the thread during call to ContextAction.run(Context). +

+ It is allowed but not advisable to use null for factory + argument in which case the global static singleton ContextFactory + instance will be used to create new context instances. +

+

+
See Also:
ContextFactory.call(ContextAction)
+
+
+
+ +

+addContextListener

+
+public static void addContextListener(org.mozilla.javascript.ContextListener listener)
+
+
Deprecated.  +

+

+
See Also:
ContextFactory.addListener(ContextFactory.Listener), +ContextFactory.getGlobal()
+
+
+
+ +

+removeContextListener

+
+public static void removeContextListener(org.mozilla.javascript.ContextListener listener)
+
+
Deprecated.  +

+

+
See Also:
ContextFactory.removeListener(ContextFactory.Listener), +ContextFactory.getGlobal()
+
+
+
+ +

+getFactory

+
+public final ContextFactory getFactory()
+
+
Return ContextFactory instance used to create this Context. +

+

+
+
+
+
+ +

+isSealed

+
+public final boolean isSealed()
+
+
Checks if this is a sealed Context. A sealed Context instance does not + allow to modify any of its properties and will throw an exception + on any such attempt. +

+

+
See Also:
seal(Object sealKey)
+
+
+
+ +

+seal

+
+public final void seal(java.lang.Object sealKey)
+
+
Seal this Context object so any attempt to modify any of its properties + including calling enter() and exit() methods will + throw an exception. +

+ If sealKey is not null, calling + unseal(Object sealKey) with the same key unseals + the object. If sealKey is null, unsealing is no longer possible. +

+

+
See Also:
isSealed(), +unseal(Object)
+
+
+
+ +

+unseal

+
+public final void unseal(java.lang.Object sealKey)
+
+
Unseal previously sealed Context object. + The sealKey argument should not be null and should match + sealKey suplied with the last call to + seal(Object) or an exception will be thrown. +

+

+
See Also:
isSealed(), +seal(Object sealKey)
+
+
+
+ +

+getLanguageVersion

+
+public final int getLanguageVersion()
+
+
Get the current language version. +

+ The language version number affects JavaScript semantics as detailed + in the overview documentation. +

+

+ +
Returns:
an integer that is one of VERSION_1_0, VERSION_1_1, etc.
+
+
+
+ +

+setLanguageVersion

+
+public void setLanguageVersion(int version)
+
+
Set the language version. + +

+ Setting the language version will affect functions and scripts compiled + subsequently. See the overview documentation for version-specific + behavior. +

+

+
Parameters:
version - the version as specified by VERSION_1_0, VERSION_1_1, etc.
+
+
+
+ +

+isValidLanguageVersion

+
+public static boolean isValidLanguageVersion(int version)
+
+
+
+
+
+
+ +

+checkLanguageVersion

+
+public static void checkLanguageVersion(int version)
+
+
+
+
+
+
+ +

+getImplementationVersion

+
+public final java.lang.String getImplementationVersion()
+
+
Get the implementation version. + +

+ The implementation version is of the form +

+    "name langVer release relNum date"
+ 
+ where name is the name of the product, langVer is + the language version, relNum is the release number, and + date is the release date for that specific + release in the form "yyyy mm dd". +

+

+ +
Returns:
a string that encodes the product, language version, release + number, and date.
+
+
+
+ +

+getErrorReporter

+
+public final ErrorReporter getErrorReporter()
+
+
Get the current error reporter. +

+

+
See Also:
ErrorReporter
+
+
+
+ +

+setErrorReporter

+
+public final ErrorReporter setErrorReporter(ErrorReporter reporter)
+
+
Change the current error reporter. +

+

+ +
Returns:
the previous error reporter
See Also:
ErrorReporter
+
+
+
+ +

+getLocale

+
+public final java.util.Locale getLocale()
+
+
Get the current locale. Returns the default locale if none has + been set. +

+

+
See Also:
Locale
+
+
+
+ +

+setLocale

+
+public final java.util.Locale setLocale(java.util.Locale loc)
+
+
Set the current locale. +

+

+
See Also:
Locale
+
+
+
+ +

+addPropertyChangeListener

+
+public final void addPropertyChangeListener(java.beans.PropertyChangeListener l)
+
+
Register an object to receive notifications when a bound property + has changed +

+

+
Parameters:
l - the listener
See Also:
PropertyChangeEvent, +removePropertyChangeListener(java.beans.PropertyChangeListener)
+
+
+
+ +

+removePropertyChangeListener

+
+public final void removePropertyChangeListener(java.beans.PropertyChangeListener l)
+
+
Remove an object from the list of objects registered to receive + notification of changes to a bounded property +

+

+
Parameters:
l - the listener
See Also:
PropertyChangeEvent, +addPropertyChangeListener(java.beans.PropertyChangeListener)
+
+
+
+ +

+reportWarning

+
+public static void reportWarning(java.lang.String message,
+                                 java.lang.String sourceName,
+                                 int lineno,
+                                 java.lang.String lineSource,
+                                 int lineOffset)
+
+
Report a warning using the error reporter for the current thread. +

+

+
Parameters:
message - the warning message to report
sourceName - a string describing the source, such as a filename
lineno - the starting line number
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
See Also:
ErrorReporter
+
+
+
+ +

+reportWarning

+
+public static void reportWarning(java.lang.String message)
+
+
Report a warning using the error reporter for the current thread. +

+

+
Parameters:
message - the warning message to report
See Also:
ErrorReporter
+
+
+
+ +

+reportWarning

+
+public static void reportWarning(java.lang.String message,
+                                 java.lang.Throwable t)
+
+
+
+
+
+
+ +

+reportError

+
+public static void reportError(java.lang.String message,
+                               java.lang.String sourceName,
+                               int lineno,
+                               java.lang.String lineSource,
+                               int lineOffset)
+
+
Report an error using the error reporter for the current thread. +

+

+
Parameters:
message - the error message to report
sourceName - a string describing the source, such as a filename
lineno - the starting line number
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
See Also:
ErrorReporter
+
+
+
+ +

+reportError

+
+public static void reportError(java.lang.String message)
+
+
Report an error using the error reporter for the current thread. +

+

+
Parameters:
message - the error message to report
See Also:
ErrorReporter
+
+
+
+ +

+reportRuntimeError

+
+public static EvaluatorException reportRuntimeError(java.lang.String message,
+                                                    java.lang.String sourceName,
+                                                    int lineno,
+                                                    java.lang.String lineSource,
+                                                    int lineOffset)
+
+
Report a runtime error using the error reporter for the current thread. +

+

+
Parameters:
message - the error message to report
sourceName - a string describing the source, such as a filename
lineno - the starting line number
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected +
Returns:
a runtime exception that will be thrown to terminate the + execution of the script
See Also:
ErrorReporter
+
+
+
+ +

+reportRuntimeError

+
+public static EvaluatorException reportRuntimeError(java.lang.String message)
+
+
Report a runtime error using the error reporter for the current thread. +

+

+
Parameters:
message - the error message to report
See Also:
ErrorReporter
+
+
+
+ +

+initStandardObjects

+
+public final ScriptableObject initStandardObjects()
+
+
Initialize the standard objects. + + Creates instances of the standard objects and their constructors + (Object, String, Number, Date, etc.), setting up 'scope' to act + as a global object as in ECMA 15.1.

+ + This method must be called to initialize a scope before scripts + can be evaluated in that scope.

+ + This method does not affect the Context it is called upon. +

+

+ +
Returns:
the initialized scope
+
+
+
+ +

+initStandardObjects

+
+public final Scriptable initStandardObjects(ScriptableObject scope)
+
+
Initialize the standard objects. + + Creates instances of the standard objects and their constructors + (Object, String, Number, Date, etc.), setting up 'scope' to act + as a global object as in ECMA 15.1.

+ + This method must be called to initialize a scope before scripts + can be evaluated in that scope.

+ + This method does not affect the Context it is called upon. +

+

+
Parameters:
scope - the scope to initialize, or null, in which case a new + object will be created to serve as the scope +
Returns:
the initialized scope. The method returns the value of the scope + argument if it is not null or newly allocated scope object which + is an instance ScriptableObject.
+
+
+
+ +

+initStandardObjects

+
+public ScriptableObject initStandardObjects(ScriptableObject scope,
+                                            boolean sealed)
+
+
Initialize the standard objects. + + Creates instances of the standard objects and their constructors + (Object, String, Number, Date, etc.), setting up 'scope' to act + as a global object as in ECMA 15.1.

+ + This method must be called to initialize a scope before scripts + can be evaluated in that scope.

+ + This method does not affect the Context it is called upon.

+ + This form of the method also allows for creating "sealed" standard + objects. An object that is sealed cannot have properties added, changed, + or removed. This is useful to create a "superglobal" that can be shared + among several top-level objects. Note that sealing is not allowed in + the current ECMA/ISO language specification, but is likely for + the next version. +

+

+
Parameters:
scope - the scope to initialize, or null, in which case a new + object will be created to serve as the scope
sealed - whether or not to create sealed standard objects that + cannot be modified. +
Returns:
the initialized scope. The method returns the value of the scope + argument if it is not null or newly allocated scope object.
Since:
+
1.4R3
+
+
+
+
+ +

+getUndefinedValue

+
+public static java.lang.Object getUndefinedValue()
+
+
Get the singleton object that represents the JavaScript Undefined value. +

+

+
+
+
+
+ +

+evaluateString

+
+public final java.lang.Object evaluateString(Scriptable scope,
+                                             java.lang.String source,
+                                             java.lang.String sourceName,
+                                             int lineno,
+                                             java.lang.Object securityDomain)
+
+
Evaluate a JavaScript source string. + + The provided source name and line number are used for error messages + and for producing debug information. +

+

+
Parameters:
scope - the scope to execute in
source - the JavaScript source
sourceName - a string describing the source, such as a filename
lineno - the starting line number
securityDomain - an arbitrary object that specifies security + information about the origin or owner of the script. For + implementations that don't care about security, this value + may be null. +
Returns:
the result of evaluating the string
See Also:
SecurityController
+
+
+
+ +

+evaluateReader

+
+public final java.lang.Object evaluateReader(Scriptable scope,
+                                             java.io.Reader in,
+                                             java.lang.String sourceName,
+                                             int lineno,
+                                             java.lang.Object securityDomain)
+                                      throws java.io.IOException
+
+
Evaluate a reader as JavaScript source. + + All characters of the reader are consumed. +

+

+
Parameters:
scope - the scope to execute in
in - the Reader to get JavaScript source from
sourceName - a string describing the source, such as a filename
lineno - the starting line number
securityDomain - an arbitrary object that specifies security + information about the origin or owner of the script. For + implementations that don't care about security, this value + may be null. +
Returns:
the result of evaluating the source +
Throws: +
java.io.IOException - if an IOException was generated by the Reader
+
+
+
+ +

+stringIsCompilableUnit

+
+public final boolean stringIsCompilableUnit(java.lang.String source)
+
+
Check whether a string is ready to be compiled. +

+ stringIsCompilableUnit is intended to support interactive compilation of + javascript. If compiling the string would result in an error + that might be fixed by appending more source, this method + returns false. In every other case, it returns true. +

+ Interactive shells may accumulate source lines, using this + method after each new line is appended to check whether the + statement being entered is complete. +

+

+
Parameters:
source - the source buffer to check +
Returns:
whether the source is ready for compilation
Since:
+
1.4 Release 2
+
+
+
+
+ +

+compileReader

+
+public final Script compileReader(Scriptable scope,
+                                  java.io.Reader in,
+                                  java.lang.String sourceName,
+                                  int lineno,
+                                  java.lang.Object securityDomain)
+                           throws java.io.IOException
+
+
Deprecated.  +

+

+ +
Throws: +
java.io.IOException
See Also:
compileReader(Reader in, String sourceName, int lineno, + Object securityDomain)
+
+
+
+ +

+compileReader

+
+public final Script compileReader(java.io.Reader in,
+                                  java.lang.String sourceName,
+                                  int lineno,
+                                  java.lang.Object securityDomain)
+                           throws java.io.IOException
+
+
Compiles the source in the given reader. +

+ Returns a script that may later be executed. + Will consume all the source in the reader. +

+

+
Parameters:
in - the input reader
sourceName - a string describing the source, such as a filename
lineno - the starting line number for reporting errors
securityDomain - an arbitrary object that specifies security + information about the origin or owner of the script. For + implementations that don't care about security, this value + may be null. +
Returns:
a script that may later be executed +
Throws: +
java.io.IOException - if an IOException was generated by the Reader
See Also:
Script
+
+
+
+ +

+compileString

+
+public final Script compileString(java.lang.String source,
+                                  java.lang.String sourceName,
+                                  int lineno,
+                                  java.lang.Object securityDomain)
+
+
Compiles the source in the given string. +

+ Returns a script that may later be executed. +

+

+
Parameters:
source - the source string
sourceName - a string describing the source, such as a filename
lineno - the starting line number for reporting errors
securityDomain - an arbitrary object that specifies security + information about the origin or owner of the script. For + implementations that don't care about security, this value + may be null. +
Returns:
a script that may later be executed
See Also:
Script
+
+
+
+ +

+compileFunction

+
+public final Function compileFunction(Scriptable scope,
+                                      java.lang.String source,
+                                      java.lang.String sourceName,
+                                      int lineno,
+                                      java.lang.Object securityDomain)
+
+
Compile a JavaScript function. +

+ The function source must be a function definition as defined by + ECMA (e.g., "function f(a) { return a; }"). +

+

+
Parameters:
scope - the scope to compile relative to
source - the function definition source
sourceName - a string describing the source, such as a filename
lineno - the starting line number
securityDomain - an arbitrary object that specifies security + information about the origin or owner of the script. For + implementations that don't care about security, this value + may be null. +
Returns:
a Function that may later be called
See Also:
Function
+
+
+
+ +

+decompileScript

+
+public final java.lang.String decompileScript(Script script,
+                                              int indent)
+
+
Decompile the script. +

+ The canonical source of the script is returned. +

+

+
Parameters:
script - the script to decompile
indent - the number of spaces to indent the result +
Returns:
a string representing the script source
+
+
+
+ +

+decompileFunction

+
+public final java.lang.String decompileFunction(Function fun,
+                                                int indent)
+
+
Decompile a JavaScript Function. +

+ Decompiles a previously compiled JavaScript function object to + canonical source. +

+ Returns function body of '[native code]' if no decompilation + information is available. +

+

+
Parameters:
fun - the JavaScript function to decompile
indent - the number of spaces to indent the result +
Returns:
a string representing the function source
+
+
+
+ +

+decompileFunctionBody

+
+public final java.lang.String decompileFunctionBody(Function fun,
+                                                    int indent)
+
+
Decompile the body of a JavaScript Function. +

+ Decompiles the body a previously compiled JavaScript Function + object to canonical source, omitting the function header and + trailing brace. + + Returns '[native code]' if no decompilation information is available. +

+

+
Parameters:
fun - the JavaScript function to decompile
indent - the number of spaces to indent the result +
Returns:
a string representing the function body source.
+
+
+
+ +

+newObject

+
+public final Scriptable newObject(Scriptable scope)
+
+
Create a new JavaScript object. + + Equivalent to evaluating "new Object()". +

+

+
Parameters:
scope - the scope to search for the constructor and to evaluate + against +
Returns:
the new object
+
+
+
+ +

+newObject

+
+public final Scriptable newObject(Scriptable scope,
+                                  java.lang.String constructorName)
+
+
Create a new JavaScript object by executing the named constructor. + + The call newObject(scope, "Foo") is equivalent to + evaluating "new Foo()". +

+

+
Parameters:
scope - the scope to search for the constructor and to evaluate against
constructorName - the name of the constructor to call +
Returns:
the new object
+
+
+
+ +

+newObject

+
+public final Scriptable newObject(Scriptable scope,
+                                  java.lang.String constructorName,
+                                  java.lang.Object[] args)
+
+
Creates a new JavaScript object by executing the named constructor. + + Searches scope for the named constructor, calls it with + the given arguments, and returns the result.

+ + The code +

+ Object[] args = { "a", "b" };
+ newObject(scope, "Foo", args)
+ is equivalent to evaluating "new Foo('a', 'b')", assuming that the Foo + constructor has been defined in scope. +

+

+
Parameters:
scope - The scope to search for the constructor and to evaluate + against
constructorName - the name of the constructor to call
args - the array of arguments for the constructor +
Returns:
the new object
+
+
+
+ +

+newArray

+
+public final Scriptable newArray(Scriptable scope,
+                                 int length)
+
+
Create an array with a specified initial length. +

+

+

+
Parameters:
scope - the scope to create the object in
length - the initial length (JavaScript arrays may have + additional properties added dynamically). +
Returns:
the new array object
+
+
+
+ +

+newArray

+
+public final Scriptable newArray(Scriptable scope,
+                                 java.lang.Object[] elements)
+
+
Create an array with a set of initial elements. +

+

+
Parameters:
scope - the scope to create the object in.
elements - the initial elements. Each object in this array + must be an acceptable JavaScript type and type + of array should be exactly Object[], not + SomeObjectSubclass[]. +
Returns:
the new array object.
+
+
+
+ +

+getElements

+
+public final java.lang.Object[] getElements(Scriptable object)
+
+
Get the elements of a JavaScript array. +

+ If the object defines a length property convertible to double number, + then the number is converted Uint32 value as defined in Ecma 9.6 + and Java array of that size is allocated. + The array is initialized with the values obtained by + calling get() on object for each value of i in [0,length-1]. If + there is not a defined value for a property the Undefined value + is used to initialize the corresponding element in the array. The + Java array is then returned. + If the object doesn't define a length property or it is not a number, + empty array is returned. +

+

+
Parameters:
object - the JavaScript array or array-like object +
Returns:
a Java array of objects
Since:
+
1.4 release 2
+
+
+
+
+ +

+toBoolean

+
+public static boolean toBoolean(java.lang.Object value)
+
+
Convert the value to a JavaScript boolean value. +

+ See ECMA 9.2. +

+

+
Parameters:
value - a JavaScript value +
Returns:
the corresponding boolean value converted using + the ECMA rules
+
+
+
+ +

+toNumber

+
+public static double toNumber(java.lang.Object value)
+
+
Convert the value to a JavaScript Number value. +

+ Returns a Java double for the JavaScript Number. +

+ See ECMA 9.3. +

+

+
Parameters:
value - a JavaScript value +
Returns:
the corresponding double value converted using + the ECMA rules
+
+
+
+ +

+toString

+
+public static java.lang.String toString(java.lang.Object value)
+
+
Convert the value to a JavaScript String value. +

+ See ECMA 9.8. +

+

+

+
Parameters:
value - a JavaScript value +
Returns:
the corresponding String value converted using + the ECMA rules
+
+
+
+ +

+toObject

+
+public static Scriptable toObject(java.lang.Object value,
+                                  Scriptable scope)
+
+
Convert the value to an JavaScript object value. +

+ Note that a scope must be provided to look up the constructors + for Number, Boolean, and String. +

+ See ECMA 9.9. +

+ Additionally, arbitrary Java objects and classes will be + wrapped in a Scriptable object with its Java fields and methods + reflected as JavaScript properties of the object. +

+

+
Parameters:
value - any Java object
scope - global scope containing constructors for Number, + Boolean, and String +
Returns:
new JavaScript object
+
+
+
+ +

+toObject

+
+public static Scriptable toObject(java.lang.Object value,
+                                  Scriptable scope,
+                                  java.lang.Class staticType)
+
+
Deprecated.  +

+

+
See Also:
toObject(Object, Scriptable)
+
+
+
+ +

+javaToJS

+
+public static java.lang.Object javaToJS(java.lang.Object value,
+                                        Scriptable scope)
+
+
Convenient method to convert java value to its closest representation + in JavaScript. +

+ If value is an instance of String, Number, Boolean, Function or + Scriptable, it is returned as it and will be treated as the corresponding + JavaScript type of string, number, boolean, function and object. +

+ Note that for Number instances during any arithmetic operation in + JavaScript the engine will always use the result of + Number.doubleValue() resulting in a precision loss if + the number can not fit into double. +

+ If value is an instance of Character, it will be converted to string of + length 1 and its JavaScript type will be string. +

+ The rest of values will be wrapped as LiveConnect objects + by calling WrapFactory.wrap(Context cx, Scriptable scope, + Object obj, Class staticType) as in: +

+    Context cx = Context.getCurrentContext();
+    return cx.getWrapFactory().wrap(cx, scope, value, null);
+ 
+

+

+
Parameters:
value - any Java object
scope - top scope object +
Returns:
value suitable to pass to any API that takes JavaScript values.
+
+
+
+ +

+jsToJava

+
+public static java.lang.Object jsToJava(java.lang.Object value,
+                                        java.lang.Class desiredType)
+                                 throws EvaluatorException
+
+
Convert a JavaScript value into the desired type. + Uses the semantics defined with LiveConnect3 and throws an + Illegal argument exception if the conversion cannot be performed. +

+

+
Parameters:
value - the JavaScript value to convert
desiredType - the Java type to convert to. Primitive Java + types are represented using the TYPE fields in the corresponding + wrapper class in java.lang. +
Returns:
the converted value +
Throws: +
EvaluatorException - if the conversion cannot be performed
+
+
+
+ +

+toType

+
+public static java.lang.Object toType(java.lang.Object value,
+                                      java.lang.Class desiredType)
+                               throws java.lang.IllegalArgumentException
+
+
Deprecated.  +

+

+ +
Throws: +
java.lang.IllegalArgumentException - if the conversion cannot be performed. + Note that jsToJava(Object, Class) throws + EvaluatorException instead.
See Also:
jsToJava(Object, Class)
+
+
+
+ +

+throwAsScriptRuntimeEx

+
+public static java.lang.RuntimeException throwAsScriptRuntimeEx(java.lang.Throwable e)
+
+
Rethrow the exception wrapping it as the script runtime exception. + Unless the exception is instance of EcmaError or + EvaluatorException it will be wrapped as + WrappedException, a subclass of EvaluatorException. + The resulting exception object always contains + source name and line number of script that triggered exception. +

+ This method always throws an exception, its return value is provided + only for convenience to allow a usage like: +

+ throw Context.throwAsScriptRuntimeEx(ex);
+ 
+ to indicate that code after the method is unreachable. +

+

+ +
Throws: +
EvaluatorException +
EcmaError
+
+
+
+ +

+isGeneratingDebug

+
+public final boolean isGeneratingDebug()
+
+
Tell whether debug information is being generated. +

+

+
Since:
+
1.3
+
+
+
+
+ +

+setGeneratingDebug

+
+public final void setGeneratingDebug(boolean generatingDebug)
+
+
Specify whether or not debug information should be generated. +

+ Setting the generation of debug information on will set the + optimization level to zero. +

+

+
Since:
+
1.3
+
+
+
+
+ +

+isGeneratingSource

+
+public final boolean isGeneratingSource()
+
+
Tell whether source information is being generated. +

+

+
Since:
+
1.3
+
+
+
+
+ +

+setGeneratingSource

+
+public final void setGeneratingSource(boolean generatingSource)
+
+
Specify whether or not source information should be generated. +

+ Without source information, evaluating the "toString" method + on JavaScript functions produces only "[native code]" for + the body of the function. + Note that code generated without source is not fully ECMA + conformant. +

+

+
Since:
+
1.3
+
+
+
+
+ +

+getOptimizationLevel

+
+public final int getOptimizationLevel()
+
+
Get the current optimization level. +

+ The optimization level is expressed as an integer between -1 and + 9. +

+

+
Since:
+
1.3
+
+
+
+
+ +

+setOptimizationLevel

+
+public final void setOptimizationLevel(int optimizationLevel)
+
+
Set the current optimization level. +

+ The optimization level is expected to be an integer between -1 and + 9. Any negative values will be interpreted as -1, and any values + greater than 9 will be interpreted as 9. + An optimization level of -1 indicates that interpretive mode will + always be used. Levels 0 through 9 indicate that class files may + be generated. Higher optimization levels trade off compile time + performance for runtime performance. + The optimizer level can't be set greater than -1 if the optimizer + package doesn't exist at run time. +

+

+
Parameters:
optimizationLevel - an integer indicating the level of + optimization to perform
Since:
+
1.3
+
+
+
+
+ +

+isValidOptimizationLevel

+
+public static boolean isValidOptimizationLevel(int optimizationLevel)
+
+
+
+
+
+
+ +

+checkOptimizationLevel

+
+public static void checkOptimizationLevel(int optimizationLevel)
+
+
+
+
+
+
+ +

+getMaximumInterpreterStackDepth

+
+public final int getMaximumInterpreterStackDepth()
+
+
Returns the maximum stack depth (in terms of number of call frames) + allowed in a single invocation of interpreter. If the set depth would be + exceeded, the interpreter will throw an EvaluatorException in the script. + Defaults to Integer.MAX_VALUE. The setting only has effect for + interpreted functions (those compiled with optimization level set to -1). + As the interpreter doesn't use the Java stack but rather manages its own + stack in the heap memory, a runaway recursion in interpreted code would + eventually consume all available memory and cause OutOfMemoryError + instead of a StackOverflowError limited to only a single thread. This + setting helps prevent such situations. +

+

+ +
Returns:
The current maximum interpreter stack depth.
+
+
+
+ +

+setMaximumInterpreterStackDepth

+
+public final void setMaximumInterpreterStackDepth(int max)
+
+
Sets the maximum stack depth (in terms of number of call frames) + allowed in a single invocation of interpreter. If the set depth would be + exceeded, the interpreter will throw an EvaluatorException in the script. + Defaults to Integer.MAX_VALUE. The setting only has effect for + interpreted functions (those compiled with optimization level set to -1). + As the interpreter doesn't use the Java stack but rather manages its own + stack in the heap memory, a runaway recursion in interpreted code would + eventually consume all available memory and cause OutOfMemoryError + instead of a StackOverflowError limited to only a single thread. This + setting helps prevent such situations. +

+

+
Parameters:
max - the new maximum interpreter stack depth +
Throws: +
java.lang.IllegalStateException - if this context's optimization level is not + -1 +
java.lang.IllegalArgumentException - if the new depth is not at least 1
+
+
+
+ +

+setSecurityController

+
+public final void setSecurityController(SecurityController controller)
+
+
Set the security controller for this context. +

SecurityController may only be set if it is currently null + and SecurityController.hasGlobal() is false. + Otherwise a SecurityException is thrown. +

+

+
Parameters:
controller - a SecurityController object +
Throws: +
java.lang.SecurityException - if there is already a SecurityController + object for this Context or globally installed.
See Also:
SecurityController.initGlobal(SecurityController controller), +SecurityController.hasGlobal()
+
+
+
+ +

+setClassShutter

+
+public final void setClassShutter(ClassShutter shutter)
+
+
Set the LiveConnect access filter for this context. +

ClassShutter may only be set if it is currently null. + Otherwise a SecurityException is thrown. +

+

+
Parameters:
shutter - a ClassShutter object +
Throws: +
java.lang.SecurityException - if there is already a ClassShutter + object for this Context
+
+
+
+ +

+getThreadLocal

+
+public final java.lang.Object getThreadLocal(java.lang.Object key)
+
+
Get a value corresponding to a key. +

+ Since the Context is associated with a thread it can be + used to maintain values that can be later retrieved using + the current thread. +

+ Note that the values are maintained with the Context, so + if the Context is disassociated from the thread the values + cannot be retrieved. Also, if private data is to be maintained + in this manner the key should be a java.lang.Object + whose reference is not divulged to untrusted code. +

+

+
Parameters:
key - the key used to lookup the value +
Returns:
a value previously stored using putThreadLocal.
+
+
+
+ +

+putThreadLocal

+
+public final void putThreadLocal(java.lang.Object key,
+                                 java.lang.Object value)
+
+
Put a value that can later be retrieved using a given key. +

+

+

+
Parameters:
key - the key used to index the value
value - the value to save
+
+
+
+ +

+removeThreadLocal

+
+public final void removeThreadLocal(java.lang.Object key)
+
+
Remove values from thread-local storage. +

+

+
Parameters:
key - the key for the entry to remove.
Since:
+
1.5 release 2
+
+
+
+
+ +

+hasCompileFunctionsWithDynamicScope

+
+public final boolean hasCompileFunctionsWithDynamicScope()
+
+
Deprecated.  +

+

+
See Also:
FEATURE_DYNAMIC_SCOPE, +hasFeature(int)
+
+
+
+ +

+setCompileFunctionsWithDynamicScope

+
+public final void setCompileFunctionsWithDynamicScope(boolean flag)
+
+
Deprecated.  +

+

+
See Also:
FEATURE_DYNAMIC_SCOPE, +hasFeature(int)
+
+
+
+ +

+setCachingEnabled

+
+public static void setCachingEnabled(boolean cachingEnabled)
+
+
Deprecated.  +

+

+
See Also:
ClassCache.get(Scriptable), +ClassCache.setCachingEnabled(boolean)
+
+
+
+ +

+setWrapFactory

+
+public final void setWrapFactory(WrapFactory wrapFactory)
+
+
Set a WrapFactory for this Context. +

+ The WrapFactory allows custom object wrapping behavior for + Java object manipulated with JavaScript. +

+

+
Since:
+
1.5 Release 4
+
See Also:
WrapFactory
+
+
+
+ +

+getWrapFactory

+
+public final WrapFactory getWrapFactory()
+
+
Return the current WrapFactory, or null if none is defined. +

+

+
Since:
+
1.5 Release 4
+
See Also:
WrapFactory
+
+
+
+ +

+getDebugger

+
+public final org.mozilla.javascript.debug.Debugger getDebugger()
+
+
Return the current debugger. +

+

+ +
Returns:
the debugger, or null if none is attached.
+
+
+
+ +

+getDebuggerContextData

+
+public final java.lang.Object getDebuggerContextData()
+
+
Return the debugger context data associated with current context. +

+

+ +
Returns:
the debugger data, or null if debugger is not attached
+
+
+
+ +

+setDebugger

+
+public final void setDebugger(org.mozilla.javascript.debug.Debugger debugger,
+                              java.lang.Object contextData)
+
+
Set the associated debugger. +

+

+
Parameters:
debugger - the debugger to be used on callbacks from + the engine.
contextData - arbitrary object that debugger can use to store + per Context data.
+
+
+
+ +

+getDebuggableView

+
+public static DebuggableScript getDebuggableView(Script script)
+
+
Return DebuggableScript instance if any associated with the script. + If callable supports DebuggableScript implementation, the method + returns it. Otherwise null is returned. +

+

+
+
+
+
+ +

+hasFeature

+
+public boolean hasFeature(int featureIndex)
+
+
Controls certain aspects of script semantics. + Should be overwritten to alter default behavior. +

+ The default implementation calls + ContextFactory.hasFeature(Context cx, int featureIndex) + that allows to customize Context behavior without introducing + Context subclasses. ContextFactory documentation gives + an example of hasFeature implementation. +

+

+
Parameters:
featureIndex - feature index to check +
Returns:
true if the featureIndex feature is turned on
See Also:
FEATURE_NON_ECMA_GET_YEAR, +FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME, +FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER, +FEATURE_TO_STRING_AS_SOURCE, +FEATURE_PARENT_PROTO_PROPRTIES, +FEATURE_E4X, +FEATURE_DYNAMIC_SCOPE, +FEATURE_STRICT_VARS, +FEATURE_STRICT_EVAL, +FEATURE_LOCATION_INFORMATION_IN_ERROR, +FEATURE_STRICT_MODE, +FEATURE_WARNING_AS_ERROR, +FEATURE_ENHANCED_JAVA_ACCESS
+
+
+
+ +

+getE4xImplementationFactory

+
+public org.mozilla.javascript.xml.XMLLib.Factory getE4xImplementationFactory()
+
+
Returns an object which specifies an E4X implementation to use within + this Context. Note + that the XMLLib.Factory interface should be considered experimental. + + The default implementation uses the implementation provided by this + Context's ContextFactory. +

+

+ +
Returns:
An XMLLib.Factory. Should not return null if + FEATURE_E4X is enabled. See hasFeature(int).
+
+
+
+ +

+getInstructionObserverThreshold

+
+public final int getInstructionObserverThreshold()
+
+
Get threshold of executed instructions counter that triggers call to + observeInstructionCount(). + When the threshold is zero, instruction counting is disabled, + otherwise each time the run-time executes at least the threshold value + of script instructions, observeInstructionCount() will + be called. +

+

+
+
+
+
+ +

+setInstructionObserverThreshold

+
+public final void setInstructionObserverThreshold(int threshold)
+
+
Set threshold of executed instructions counter that triggers call to + observeInstructionCount(). + When the threshold is zero, instruction counting is disabled, + otherwise each time the run-time executes at least the threshold value + of script instructions, observeInstructionCount() will + be called.

+ Note that the meaning of "instruction" is not guaranteed to be + consistent between compiled and interpretive modes: executing a given + script or function in the different modes will result in different + instruction counts against the threshold. + setGenerateObserverCount(boolean) is called with true if + threshold is greater than zero, false otherwise. +

+

+
Parameters:
threshold - The instruction threshold
+
+
+
+ +

+setGenerateObserverCount

+
+public void setGenerateObserverCount(boolean generateObserverCount)
+
+
Turn on or off generation of code with callbacks to + track the count of executed instructions. + Currently only affects JVM byte code generation: this slows down the + generated code, but code generated without the callbacks will not + be counted toward instruction thresholds. Rhino's interpretive + mode does instruction counting without inserting callbacks, so + there is no requirement to compile code differently. +

+

+
Parameters:
generateObserverCount - if true, generated code will contain + calls to accumulate an estimate of the instructions executed.
+
+
+
+ +

+observeInstructionCount

+
+protected void observeInstructionCount(int instructionCount)
+
+
Allow application to monitor counter of executed script instructions + in Context subclasses. + Run-time calls this when instruction counting is enabled and the counter + reaches limit set by setInstructionObserverThreshold(). + The method is useful to observe long running scripts and if necessary + to terminate them. +

+ The instruction counting support is available only for interpreted + scripts generated when the optimization level is set to -1. +

+ The default implementation calls + ContextFactory.observeInstructionCount(Context cx, + int instructionCount) + that allows to customize Context behavior without introducing + Context subclasses. +

+

+
Parameters:
instructionCount - amount of script instruction executed since + last call to observeInstructionCount +
Throws: +
java.lang.Error - to terminate the script
See Also:
setOptimizationLevel(int)
+
+
+
+ +

+createClassLoader

+
+public GeneratedClassLoader createClassLoader(java.lang.ClassLoader parent)
+
+
Create class loader for generated classes. + The method calls ContextFactory.createClassLoader(ClassLoader) + using the result of getFactory(). +

+

+
+
+
+
+ +

+getApplicationClassLoader

+
+public final java.lang.ClassLoader getApplicationClassLoader()
+
+
+
+
+
+
+ +

+setApplicationClassLoader

+
+public final void setApplicationClassLoader(java.lang.ClassLoader loader)
+
+
+
+
+
+
+ +

+isGeneratingDebugChanged

+
+public final boolean isGeneratingDebugChanged()
+
+
+
+
+
+
+ +

+addActivationName

+
+public void addActivationName(java.lang.String name)
+
+
Add a name to the list of names forcing the creation of real + activation objects for functions. +

+

+
Parameters:
name - the name of the object to add to the list
+
+
+
+ +

+isActivationNeeded

+
+public final boolean isActivationNeeded(java.lang.String name)
+
+
Check whether the name is in the list of names of objects + forcing the creation of activation objects. +

+

+
Parameters:
name - the name of the object to test +
Returns:
true if an function activation object is needed.
+
+
+
+ +

+removeActivationName

+
+public void removeActivationName(java.lang.String name)
+
+
Remove a name from the list of names forcing the creation of real + activation objects for functions. +

+

+
Parameters:
name - the name of the object to remove from the list
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html new file mode 100644 index 0000000..8e7116c --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextAction.html @@ -0,0 +1,214 @@ + + + + + + +ContextAction (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface ContextAction

+
+
+
public interface ContextAction
+ + +

+Interface to represent arbitrary action that requires to have Context + object associated with the current thread for its execution. +

+ +

+


+ +

+ + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectrun(Context cx) + +
+          Execute action using the supplied Context instance.
+  +

+ + + + + + + + +
+Method Detail
+ +

+run

+
+java.lang.Object run(Context cx)
+
+
Execute action using the supplied Context instance. + When Rhino runtime calls the method, cx will be associated + with the current thread as active context. +

+

+
See Also:
Context.call(ContextAction), +ContextFactory.call(ContextAction)
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html new file mode 100644 index 0000000..6290c8c --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.Listener.html @@ -0,0 +1,236 @@ + + + + + + +ContextFactory.Listener (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface ContextFactory.Listener

+
+
Enclosing class:
ContextFactory
+
+
+
+
public static interface ContextFactory.Listener
+ + +

+Listener of Context creation and release events. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ voidcontextCreated(Context cx) + +
+          Notify about newly created Context object.
+ voidcontextReleased(Context cx) + +
+          Notify that the specified Context instance is no longer + associated with the current thread.
+  +

+ + + + + + + + +
+Method Detail
+ +

+contextCreated

+
+void contextCreated(Context cx)
+
+
Notify about newly created Context object. +

+

+
+
+
+
+ +

+contextReleased

+
+void contextReleased(Context cx)
+
+
Notify that the specified Context instance is no longer + associated with the current thread. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html new file mode 100644 index 0000000..ef61a6f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html @@ -0,0 +1,935 @@ + + + + + + +ContextFactory (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class ContextFactory

+
+java.lang.Object
+  extended by org.mozilla.javascript.ContextFactory
+
+
+
+
public class ContextFactory
extends java.lang.Object
+ + +

+Factory class that Rhino runtime uses to create new Context + instances. A ContextFactory can also notify listeners + about context creation and release. +

+ When the Rhino runtime needs to create new Context instance during + execution of Context.enter() or Context, it will call + makeContext() of the current global ContextFactory. + See getGlobal() and initGlobal(ContextFactory). +

+ It is also possible to use explicit ContextFactory instances for Context + creation. This is useful to have a set of independent Rhino runtime + instances under single JVM. See call(ContextAction). +

+ The following example demonstrates Context customization to terminate + scripts running more then 10 seconds and to provide better compatibility + with JavaScript code using MSIE-specific features. +

+ import org.mozilla.javascript.*;
+
+ class MyFactory extends ContextFactory
+ {
+
+     // Custom Context to store execution time.
+     private static class MyContext extends Context
+     {
+         long startTime;
+     }
+
+     static {
+         // Initialize GlobalFactory with custom factory
+         ContextFactory.initGlobal(new MyFactory());
+     }
+
+     // Override makeContext()
+     protected Context makeContext()
+     {
+         MyContext cx = new MyContext();
+         // Use pure interpreter mode to allow for
+         // observeInstructionCount(Context, int) to work
+         cx.setOptimizationLevel(-1);
+         // Make Rhino runtime to call observeInstructionCount
+         // each 10000 bytecode instructions
+         cx.setInstructionObserverThreshold(10000);
+         return cx;
+     }
+
+     // Override hasFeature(Context, int)
+     public boolean hasFeature(Context cx, int featureIndex)
+     {
+         // Turn on maximum compatibility with MSIE scripts
+         switch (featureIndex) {
+             case Context.FEATURE_NON_ECMA_GET_YEAR:
+                 return true;
+
+             case Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME:
+                 return true;
+
+             case Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER:
+                 return true;
+
+             case Context.FEATURE_PARENT_PROTO_PROPERTIES:
+                 return false;
+         }
+         return super.hasFeature(cx, featureIndex);
+     }
+
+     // Override observeInstructionCount(Context, int)
+     protected void observeInstructionCount(Context cx, int instructionCount)
+     {
+         MyContext mcx = (MyContext)cx;
+         long currentTime = System.currentTimeMillis();
+         if (currentTime - mcx.startTime > 10*1000) {
+             // More then 10 seconds from Context creation time:
+             // it is time to stop the script.
+             // Throw Error instance to ensure that script will never
+             // get control back through catch or finally.
+             throw new Error();
+         }
+     }
+
+     // Override doTopCall(Callable,
+                               Context, Scriptable,
+                               Scriptable, Object[])
+     protected Object doTopCall(Callable callable,
+                                Context cx, Scriptable scope,
+                                Scriptable thisObj, Object[] args)
+     {
+         MyContext mcx = (MyContext)cx;
+         mcx.startTime = System.currentTimeMillis();
+
+         return super.doTopCall(callable, cx, scope, thisObj, args);
+     }
+
+ }
+
+ 
+

+ +

+


+ +

+ + + + + + + + + + + +
+Nested Class Summary
+static interfaceContextFactory.Listener + +
+          Listener of Context creation and release events.
+  + + + + + + + + + + +
+Constructor Summary
ContextFactory() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddListener(ContextFactory.Listener listener) + +
+           
+ java.lang.Objectcall(ContextAction action) + +
+          Call ContextAction.run(Context cx) + using the Context instance associated with the current thread.
+protected  voidcheckNotSealed() + +
+           
+protected  GeneratedClassLoadercreateClassLoader(java.lang.ClassLoader parent) + +
+          Create class loader for generated classes.
+protected  java.lang.ObjectdoTopCall(Callable callable, + Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Execute top call to script or function.
+ Contextenter() + +
+          Deprecated. use enterContext() instead
+ ContextenterContext() + +
+          Get a context associated with the current thread, creating one if need + be.
+ ContextenterContext(Context cx) + +
+          Get a Context associated with the current thread, using the given + Context if need be.
+ voidexit() + +
+          Deprecated. Use Context.exit() instead.
+ java.lang.ClassLoadergetApplicationClassLoader() + +
+          Get ClassLoader to use when searching for Java classes.
+protected  org.mozilla.javascript.xml.XMLLib.FactorygetE4xImplementationFactory() + +
+          Provides a default + XMLLib.Factory + to be used by the Context instances produced by this + factory.
+static ContextFactorygetGlobal() + +
+          Get global ContextFactory.
+static booleanhasExplicitGlobal() + +
+          Check if global factory was set.
+protected  booleanhasFeature(Context cx, + int featureIndex) + +
+          Implementation of Context.hasFeature(int featureIndex).
+ voidinitApplicationClassLoader(java.lang.ClassLoader loader) + +
+          Set explicit class loader to use when searching for Java classes.
+static voidinitGlobal(ContextFactory factory) + +
+          Set global ContextFactory.
+ booleanisSealed() + +
+          Checks if this is a sealed ContextFactory.
+protected  ContextmakeContext() + +
+          Create new Context instance to be associated with the current + thread.
+protected  voidobserveInstructionCount(Context cx, + int instructionCount) + +
+          Implementation of + Context.observeInstructionCount(int instructionCount).
+protected  voidonContextCreated(Context cx) + +
+           
+protected  voidonContextReleased(Context cx) + +
+           
+ voidremoveListener(ContextFactory.Listener listener) + +
+           
+ voidseal() + +
+          Seal this ContextFactory so any attempt to modify it like to add or + remove its listeners will throw an exception.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ContextFactory

+
+public ContextFactory()
+
+
+ + + + + + + + +
+Method Detail
+ +

+getGlobal

+
+public static ContextFactory getGlobal()
+
+
Get global ContextFactory. +

+

+
See Also:
hasExplicitGlobal(), +initGlobal(ContextFactory)
+
+
+
+ +

+hasExplicitGlobal

+
+public static boolean hasExplicitGlobal()
+
+
Check if global factory was set. + Return true to indicate that initGlobal(ContextFactory) was + already called and false to indicate that the global factory was not + explicitly set. +

+

+
See Also:
getGlobal(), +initGlobal(ContextFactory)
+
+
+
+ +

+initGlobal

+
+public static void initGlobal(ContextFactory factory)
+
+
Set global ContextFactory. + The method can only be called once. +

+

+
See Also:
getGlobal(), +hasExplicitGlobal()
+
+
+
+ +

+makeContext

+
+protected Context makeContext()
+
+
Create new Context instance to be associated with the current + thread. + This is a callback method used by Rhino to create Context + instance when it is necessary to associate one with the current + execution thread. makeContext() is allowed to call + Context.seal(Object) on the result to prevent + Context changes by hostile scripts or applets. +

+

+
+
+
+
+ +

+hasFeature

+
+protected boolean hasFeature(Context cx,
+                             int featureIndex)
+
+
Implementation of Context.hasFeature(int featureIndex). + This can be used to customize Context without introducing + additional subclasses. +

+

+
+
+
+
+ +

+getE4xImplementationFactory

+
+protected org.mozilla.javascript.xml.XMLLib.Factory getE4xImplementationFactory()
+
+
Provides a default + XMLLib.Factory + to be used by the Context instances produced by this + factory. See Context.getE4xImplementationFactory() for details. + + May return null, in which case E4X functionality is not supported in + Rhino. + + The default implementation now prefers the DOM3 E4X implementation. +

+

+
+
+
+
+ +

+createClassLoader

+
+protected GeneratedClassLoader createClassLoader(java.lang.ClassLoader parent)
+
+
Create class loader for generated classes. + This method creates an instance of the default implementation + of GeneratedClassLoader. Rhino uses this interface to load + generated JVM classes when no SecurityController + is installed. + Application can override the method to provide custom class loading. +

+

+
+
+
+
+ +

+getApplicationClassLoader

+
+public final java.lang.ClassLoader getApplicationClassLoader()
+
+
Get ClassLoader to use when searching for Java classes. + Unless it was explicitly initialized with + initApplicationClassLoader(ClassLoader) the method returns + null to indicate that Thread.getContextClassLoader() should be used. +

+

+
+
+
+
+ +

+initApplicationClassLoader

+
+public final void initApplicationClassLoader(java.lang.ClassLoader loader)
+
+
Set explicit class loader to use when searching for Java classes. +

+

+
See Also:
getApplicationClassLoader()
+
+
+
+ +

+doTopCall

+
+protected java.lang.Object doTopCall(Callable callable,
+                                     Context cx,
+                                     Scriptable scope,
+                                     Scriptable thisObj,
+                                     java.lang.Object[] args)
+
+
Execute top call to script or function. + When the runtime is about to execute a script or function that will + create the first stack frame with scriptable code, it calls this method + to perform the real call. In this way execution of any script + happens inside this function. +

+

+
+
+
+
+ +

+observeInstructionCount

+
+protected void observeInstructionCount(Context cx,
+                                       int instructionCount)
+
+
Implementation of + Context.observeInstructionCount(int instructionCount). + This can be used to customize Context without introducing + additional subclasses. +

+

+
+
+
+
+ +

+onContextCreated

+
+protected void onContextCreated(Context cx)
+
+
+
+
+
+
+ +

+onContextReleased

+
+protected void onContextReleased(Context cx)
+
+
+
+
+
+
+ +

+addListener

+
+public final void addListener(ContextFactory.Listener listener)
+
+
+
+
+
+
+ +

+removeListener

+
+public final void removeListener(ContextFactory.Listener listener)
+
+
+
+
+
+
+ +

+isSealed

+
+public final boolean isSealed()
+
+
Checks if this is a sealed ContextFactory. +

+

+
See Also:
seal()
+
+
+
+ +

+seal

+
+public final void seal()
+
+
Seal this ContextFactory so any attempt to modify it like to add or + remove its listeners will throw an exception. +

+

+
See Also:
isSealed()
+
+
+
+ +

+checkNotSealed

+
+protected final void checkNotSealed()
+
+
+
+
+
+
+ +

+call

+
+public final java.lang.Object call(ContextAction action)
+
+
Call ContextAction.run(Context cx) + using the Context instance associated with the current thread. + If no Context is associated with the thread, then + makeContext() will be called to construct + new Context instance. The instance will be temporary associated + with the thread during call to ContextAction.run(Context). +

+

+
See Also:
call(ContextAction), +Context.call(ContextFactory factory, Callable callable, + Scriptable scope, Scriptable thisObj, + Object[] args)
+
+
+
+ +

+enterContext

+
+public Context enterContext()
+
+
Get a context associated with the current thread, creating one if need + be. The Context stores the execution state of the JavaScript engine, so + it is required that the context be entered before execution may begin. + Once a thread has entered a Context, then getCurrentContext() may be + called to find the context that is associated with the current thread. +

+ Calling enterContext() will return either the Context + currently associated with the thread, or will create a new context and + associate it with the current thread. Each call to + enterContext() must have a matching call to + Context.exit(). +

+      Context cx = contextFactory.enterContext();
+      try {
+          ...
+          cx.evaluateString(...);
+      } finally {
+          Context.exit();
+      }
+ 
+ Instead of using enterContext(), exit() pair consider + using call(ContextAction) which guarantees proper association + of Context instances with the current thread. + With this method the above example becomes: +
+      ContextFactory.call(new ContextAction() {
+          public Object run(Context cx) {
+              ...
+              cx.evaluateString(...);
+              return null;
+          }
+      });
+ 
+

+

+ +
Returns:
a Context associated with the current thread
See Also:
Context.getCurrentContext(), +Context.exit(), +call(ContextAction)
+
+
+
+ +

+enter

+
+public final Context enter()
+
+
Deprecated. use enterContext() instead +

+

+ +
Returns:
a Context associated with the current thread
+
+
+
+ +

+exit

+
+public final void exit()
+
+
Deprecated. Use Context.exit() instead. +

+

+
+
+
+
+ +

+enterContext

+
+public final Context enterContext(Context cx)
+
+
Get a Context associated with the current thread, using the given + Context if need be. +

+ The same as enterContext() except that cx + is associated with the current thread and returned if the current thread + has no associated context and cx is not associated with any + other thread. +

+

+
Parameters:
cx - a Context to associate with the thread if possible +
Returns:
a Context associated with the current thread +
Throws: +
java.lang.IllegalStateException - if cx is already associated + with a different thread
See Also:
enterContext(), +call(ContextAction)
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html new file mode 100644 index 0000000..71c774f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EcmaError.html @@ -0,0 +1,455 @@ + + + + + + +EcmaError (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class EcmaError

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by java.lang.RuntimeException
+              extended by org.mozilla.javascript.RhinoException
+                  extended by org.mozilla.javascript.EcmaError
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class EcmaError
extends RhinoException
+ + +

+The class of exceptions raised by the engine as described in + ECMA edition 3. See section 15.11.6 in particular. +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
EcmaError(Scriptable nativeError, + java.lang.String sourceName, + int lineNumber, + int columnNumber, + java.lang.String lineSource) + +
+          Deprecated. EcmaError error instances should not be constructed + explicitly since they are generated by the engine.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.Stringdetails() + +
+           
+ intgetColumnNumber() + +
+          Deprecated. Use RhinoException.columnNumber() from the super class.
+ java.lang.StringgetErrorMessage() + +
+          Gets the message corresponding to the error.
+ ScriptablegetErrorObject() + +
+          Deprecated. Always returns null.
+ intgetLineNumber() + +
+          Deprecated. Use RhinoException.lineNumber() from the super class.
+ java.lang.StringgetLineSource() + +
+          Deprecated. Use RhinoException.lineSource() from the super class.
+ java.lang.StringgetName() + +
+          Gets the name of the error.
+ java.lang.StringgetSourceName() + +
+          Deprecated. Use RhinoException.sourceName() from the super class.
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.RhinoException
columnNumber, getMessage, getScriptStackTrace, getScriptStackTrace, initColumnNumber, initLineNumber, initLineSource, initSourceName, lineNumber, lineSource, printStackTrace, printStackTrace, sourceName
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EcmaError

+
+public EcmaError(Scriptable nativeError,
+                 java.lang.String sourceName,
+                 int lineNumber,
+                 int columnNumber,
+                 java.lang.String lineSource)
+
+
Deprecated. EcmaError error instances should not be constructed + explicitly since they are generated by the engine. +

+

+ + + + + + + + +
+Method Detail
+ +

+details

+
+public java.lang.String details()
+
+
+
Overrides:
details in class RhinoException
+
+
+
+
+
+
+ +

+getName

+
+public java.lang.String getName()
+
+
Gets the name of the error. + + ECMA edition 3 defines the following + errors: EvalError, RangeError, ReferenceError, + SyntaxError, TypeError, and URIError. Additional error names + may be added in the future. + + See ECMA edition 3, 15.11.7.9. +

+

+ +
Returns:
the name of the error.
+
+
+
+ +

+getErrorMessage

+
+public java.lang.String getErrorMessage()
+
+
Gets the message corresponding to the error. + + See ECMA edition 3, 15.11.7.10. +

+

+ +
Returns:
an implemenation-defined string describing the error.
+
+
+
+ +

+getSourceName

+
+public java.lang.String getSourceName()
+
+
Deprecated. Use RhinoException.sourceName() from the super class. +

+

+
+
+
+
+ +

+getLineNumber

+
+public int getLineNumber()
+
+
Deprecated. Use RhinoException.lineNumber() from the super class. +

+

+
+
+
+
+ +

+getColumnNumber

+
+public int getColumnNumber()
+
+
Deprecated. Use RhinoException.columnNumber() from the super class. +

+

+
+
+
+
+ +

+getLineSource

+
+public java.lang.String getLineSource()
+
+
Deprecated. Use RhinoException.lineSource() from the super class. +

+

+
+
+
+
+ +

+getErrorObject

+
+public Scriptable getErrorObject()
+
+
Deprecated. Always returns null. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html new file mode 100644 index 0000000..a559d25 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ErrorReporter.html @@ -0,0 +1,299 @@ + + + + + + +ErrorReporter (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface ErrorReporter

+
+
+
public interface ErrorReporter
+ + +

+This is interface defines a protocol for the reporting of + errors during JavaScript translation or execution. +

+ +

+

+
Author:
+
Norris Boyd
+
+
+ +

+ + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voiderror(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset) + +
+          Report an error.
+ EvaluatorExceptionruntimeError(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset) + +
+          Creates an EvaluatorException that may be thrown.
+ voidwarning(java.lang.String message, + java.lang.String sourceName, + int line, + java.lang.String lineSource, + int lineOffset) + +
+          Report a warning.
+  +

+ + + + + + + + +
+Method Detail
+ +

+warning

+
+void warning(java.lang.String message,
+             java.lang.String sourceName,
+             int line,
+             java.lang.String lineSource,
+             int lineOffset)
+
+
Report a warning. + + The implementing class may choose to ignore the warning + if it desires. +

+

+
Parameters:
message - a String describing the warning
sourceName - a String describing the JavaScript source + where the warning occured; typically a filename or URL
line - the line number associated with the warning
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
+
+
+
+ +

+error

+
+void error(java.lang.String message,
+           java.lang.String sourceName,
+           int line,
+           java.lang.String lineSource,
+           int lineOffset)
+
+
Report an error. + + The implementing class is free to throw an exception if + it desires. + + If execution has not yet begun, the JavaScript engine is + free to find additional errors rather than terminating + the translation. It will not execute a script that had + errors, however. +

+

+
Parameters:
message - a String describing the error
sourceName - a String describing the JavaScript source + where the error occured; typically a filename or URL
line - the line number associated with the error
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected
+
+
+
+ +

+runtimeError

+
+EvaluatorException runtimeError(java.lang.String message,
+                                java.lang.String sourceName,
+                                int line,
+                                java.lang.String lineSource,
+                                int lineOffset)
+
+
Creates an EvaluatorException that may be thrown. + + runtimeErrors, unlike errors, will always terminate the + current script. +

+

+
Parameters:
message - a String describing the error
sourceName - a String describing the JavaScript source + where the error occured; typically a filename or URL
line - the line number associated with the error
lineSource - the text of the line (may be null)
lineOffset - the offset into lineSource where problem was detected +
Returns:
an EvaluatorException that will be thrown.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html new file mode 100644 index 0000000..6f06bb5 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/EvaluatorException.html @@ -0,0 +1,405 @@ + + + + + + +EvaluatorException (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class EvaluatorException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by java.lang.RuntimeException
+              extended by org.mozilla.javascript.RhinoException
+                  extended by org.mozilla.javascript.EvaluatorException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
Direct Known Subclasses:
WrappedException
+
+
+
+
public class EvaluatorException
extends RhinoException
+ + +

+The class of exceptions thrown by the JavaScript engine. +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + +
+Constructor Summary
EvaluatorException(java.lang.String detail) + +
+           
EvaluatorException(java.lang.String detail, + java.lang.String sourceName, + int lineNumber) + +
+          Create an exception with the specified detail message.
EvaluatorException(java.lang.String detail, + java.lang.String sourceName, + int lineNumber, + java.lang.String lineSource, + int columnNumber) + +
+          Create an exception with the specified detail message.
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intgetColumnNumber() + +
+          Deprecated. Use RhinoException.columnNumber() from the super class.
+ intgetLineNumber() + +
+          Deprecated. Use RhinoException.lineNumber() from the super class.
+ java.lang.StringgetLineSource() + +
+          Deprecated. Use RhinoException.lineSource() from the super class.
+ java.lang.StringgetSourceName() + +
+          Deprecated. Use RhinoException.sourceName() from the super class.
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.RhinoException
columnNumber, details, getMessage, getScriptStackTrace, getScriptStackTrace, initColumnNumber, initLineNumber, initLineSource, initSourceName, lineNumber, lineSource, printStackTrace, printStackTrace, sourceName
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+EvaluatorException

+
+public EvaluatorException(java.lang.String detail)
+
+
+
+ +

+EvaluatorException

+
+public EvaluatorException(java.lang.String detail,
+                          java.lang.String sourceName,
+                          int lineNumber)
+
+
Create an exception with the specified detail message. + + Errors internal to the JavaScript engine will simply throw a + RuntimeException. +

+

+
Parameters:
detail - the error message
sourceName - the name of the source reponsible for the error
lineNumber - the line number of the source
+
+
+ +

+EvaluatorException

+
+public EvaluatorException(java.lang.String detail,
+                          java.lang.String sourceName,
+                          int lineNumber,
+                          java.lang.String lineSource,
+                          int columnNumber)
+
+
Create an exception with the specified detail message. + + Errors internal to the JavaScript engine will simply throw a + RuntimeException. +

+

+
Parameters:
detail - the error message
sourceName - the name of the source responsible for the error
lineNumber - the line number of the source
columnNumber - the columnNumber of the source (may be zero if + unknown)
lineSource - the source of the line containing the error (may be + null if unknown)
+
+ + + + + + + + +
+Method Detail
+ +

+getSourceName

+
+public java.lang.String getSourceName()
+
+
Deprecated. Use RhinoException.sourceName() from the super class. +

+

+
+
+
+
+ +

+getLineNumber

+
+public int getLineNumber()
+
+
Deprecated. Use RhinoException.lineNumber() from the super class. +

+

+
+
+
+
+ +

+getColumnNumber

+
+public int getColumnNumber()
+
+
Deprecated. Use RhinoException.columnNumber() from the super class. +

+

+
+
+
+
+ +

+getLineSource

+
+public java.lang.String getLineSource()
+
+
Deprecated. Use RhinoException.lineSource() from the super class. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html new file mode 100644 index 0000000..55712dc --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Function.html @@ -0,0 +1,297 @@ + + + + + + +Function (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface Function

+
+
All Superinterfaces:
Callable, Scriptable
+
+
+
All Known Implementing Classes:
org.mozilla.javascript.BaseFunction, org.mozilla.javascript.Delegator, FunctionObject, Synchronizer
+
+
+
+
public interface Function
extends Scriptable, Callable
+ + +

+This is interface that all functions in JavaScript must implement. + The interface provides for calling functions and constructors. +

+ +

+

+
Author:
+
Norris Boyd
+
See Also:
Scriptable
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
+  + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectcall(Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Call the function.
+ Scriptableconstruct(Context cx, + Scriptable scope, + java.lang.Object[] args) + +
+          Call the function as a constructor.
+ + + + + + + +
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype
+  +

+ + + + + + + + +
+Method Detail
+ +

+call

+
+java.lang.Object call(Context cx,
+                      Scriptable scope,
+                      Scriptable thisObj,
+                      java.lang.Object[] args)
+
+
Call the function. + + Note that the array of arguments is not guaranteed to have + length greater than 0. +

+

+
Specified by:
call in interface Callable
+
+
+
Parameters:
cx - the current Context for this thread
scope - the scope to execute the function relative to. This is + set to the value returned by getParentScope() except + when the function is called from a closure.
thisObj - the JavaScript this object
args - the array of arguments +
Returns:
the result of the call
+
+
+
+ +

+construct

+
+Scriptable construct(Context cx,
+                     Scriptable scope,
+                     java.lang.Object[] args)
+
+
Call the function as a constructor. + + This method is invoked by the runtime in order to satisfy a use + of the JavaScript new operator. This method is + expected to create a new object and return it. +

+

+
+
+
+
Parameters:
cx - the current Context for this thread
scope - an enclosing scope of the caller except + when the function is called from a closure.
args - the array of arguments +
Returns:
the allocated object
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html new file mode 100644 index 0000000..4e9d011 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/FunctionObject.html @@ -0,0 +1,774 @@ + + + + + + +FunctionObject (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class FunctionObject

+
+java.lang.Object
+  extended by org.mozilla.javascript.ScriptableObject
+      extended by org.mozilla.javascript.IdScriptableObject
+          extended by org.mozilla.javascript.BaseFunction
+              extended by org.mozilla.javascript.FunctionObject
+
+
+
All Implemented Interfaces:
java.io.Serializable, Callable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, Function, org.mozilla.javascript.IdFunctionCall, Scriptable
+
+
+
+
public class FunctionObject
extends org.mozilla.javascript.BaseFunction
+ + +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intJAVA_BOOLEAN_TYPE + +
+           
+static intJAVA_DOUBLE_TYPE + +
+           
+static intJAVA_INT_TYPE + +
+           
+static intJAVA_OBJECT_TYPE + +
+           
+static intJAVA_SCRIPTABLE_TYPE + +
+           
+static intJAVA_STRING_TYPE + +
+           
+static intJAVA_UNSUPPORTED_TYPE + +
+           
+ + + + + + + +
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
+ + + + + + + +
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
+  + + + + + + + + + + +
+Constructor Summary
FunctionObject(java.lang.String name, + java.lang.reflect.Member methodOrConstructor, + Scriptable scope) + +
+          Create a JavaScript function object from a Java method.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddAsConstructor(Scriptable scope, + Scriptable prototype) + +
+          Define this function as a JavaScript constructor.
+ java.lang.Objectcall(Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Performs conversions on argument types if needed and + invokes the underlying Java method or constructor.
+static java.lang.ObjectconvertArg(Context cx, + Scriptable scope, + java.lang.Object arg, + java.lang.Class desired) + +
+          Deprecated. Use getTypeTag(Class) + and convertArg(Context, Scriptable, Object, int) + for type convertion.
+static java.lang.ObjectconvertArg(Context cx, + Scriptable scope, + java.lang.Object arg, + int typeTag) + +
+           
+ ScriptablecreateObject(Context cx, + Scriptable scope) + +
+          Return new Scriptable instance using the default + constructor for the class of the underlying Java method.
+ intgetArity() + +
+          Return the value defined by the method used to construct the object + (number of parameters of the method, or 1 if the method is a "varargs" + form).
+ java.lang.StringgetFunctionName() + +
+           
+ intgetLength() + +
+          Return the same value as getArity().
+ java.lang.reflect.MembergetMethodOrConstructor() + +
+          Get Java method or constructor this function represent.
+static intgetTypeTag(java.lang.Class type) + +
+           
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.BaseFunction
construct, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getClassName, getClassPrototype, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, hasInstance, initPrototypeId, setImmunePrototypeProperty, setInstanceIdValue
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface org.mozilla.javascript.Scriptable
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype
+  +

+ + + + + + + + +
+Field Detail
+ +

+JAVA_UNSUPPORTED_TYPE

+
+public static final int JAVA_UNSUPPORTED_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_STRING_TYPE

+
+public static final int JAVA_STRING_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_INT_TYPE

+
+public static final int JAVA_INT_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_BOOLEAN_TYPE

+
+public static final int JAVA_BOOLEAN_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_DOUBLE_TYPE

+
+public static final int JAVA_DOUBLE_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_SCRIPTABLE_TYPE

+
+public static final int JAVA_SCRIPTABLE_TYPE
+
+
+
See Also:
Constant Field Values
+
+
+ +

+JAVA_OBJECT_TYPE

+
+public static final int JAVA_OBJECT_TYPE
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+FunctionObject

+
+public FunctionObject(java.lang.String name,
+                      java.lang.reflect.Member methodOrConstructor,
+                      Scriptable scope)
+
+
Create a JavaScript function object from a Java method. + +

The member argument must be either a java.lang.reflect.Method + or a java.lang.reflect.Constructor and must match one of two forms.

+ + The first form is a member with zero or more parameters + of the following types: Object, String, boolean, Scriptable, + int, or double. The Long type is not supported + because the double representation of a long (which is the + EMCA-mandated storage type for Numbers) may lose precision. + If the member is a Method, the return value must be void or one + of the types allowed for parameters.

+ + The runtime will perform appropriate conversions based + upon the type of the parameter. A parameter type of + Object specifies that no conversions are to be done. A parameter + of type String will use Context.toString to convert arguments. + Similarly, parameters of type double, boolean, and Scriptable + will cause Context.toNumber, Context.toBoolean, and + Context.toObject, respectively, to be called.

+ + If the method is not static, the Java 'this' value will + correspond to the JavaScript 'this' value. Any attempt + to call the function with a 'this' value that is not + of the right Java type will result in an error.

+ + The second form is the variable arguments (or "varargs") + form. If the FunctionObject will be used as a constructor, + the member must have the following parameters +

+      (Context cx, Object[] args, Function ctorObj,
+       boolean inNewExpr)
+ and if it is a Method, be static and return an Object result.

+ + Otherwise, if the FunctionObject will not be used to define a + constructor, the member must be a static Method with parameters + (Context cx, Scriptable thisObj, Object[] args, + Function funObj) +

+ and an Object result.

+ + When the function varargs form is called as part of a function call, + the args parameter contains the + arguments, with thisObj + set to the JavaScript 'this' value. funObj + is the function object for the invoked function.

+ + When the constructor varargs form is called or invoked while evaluating + a new expression, args contains the + arguments, ctorObj refers to this FunctionObject, and + inNewExpr is true if and only if a new + expression caused the call. This supports defining a function that + has different behavior when called as a constructor than when + invoked as a normal function call. (For example, the Boolean + constructor, when called as a function, + will convert to boolean rather than creating a new object.)

+

+

+
Parameters:
name - the name of the function
methodOrConstructor - a java.lang.reflect.Method or a java.lang.reflect.Constructor + that defines the object
scope - enclosing scope of function
See Also:
Scriptable
+
+ + + + + + + + +
+Method Detail
+ +

+getTypeTag

+
+public static int getTypeTag(java.lang.Class type)
+
+
+ +
Returns:
One of JAVA_*_TYPE constants to indicate desired type + or JAVA_UNSUPPORTED_TYPE if the convertion is not + possible
+
+
+
+ +

+convertArg

+
+public static java.lang.Object convertArg(Context cx,
+                                          Scriptable scope,
+                                          java.lang.Object arg,
+                                          int typeTag)
+
+
+
+
+
+
+ +

+getArity

+
+public int getArity()
+
+
Return the value defined by the method used to construct the object + (number of parameters of the method, or 1 if the method is a "varargs" + form). +

+

+
Overrides:
getArity in class org.mozilla.javascript.BaseFunction
+
+
+
+
+
+
+ +

+getLength

+
+public int getLength()
+
+
Return the same value as getArity(). +

+

+
Overrides:
getLength in class org.mozilla.javascript.BaseFunction
+
+
+
+
+
+
+ +

+getFunctionName

+
+public java.lang.String getFunctionName()
+
+
+
Overrides:
getFunctionName in class org.mozilla.javascript.BaseFunction
+
+
+
+
+
+
+ +

+getMethodOrConstructor

+
+public java.lang.reflect.Member getMethodOrConstructor()
+
+
Get Java method or constructor this function represent. +

+

+
+
+
+
+ +

+addAsConstructor

+
+public void addAsConstructor(Scriptable scope,
+                             Scriptable prototype)
+
+
Define this function as a JavaScript constructor. +

+ Sets up the "prototype" and "constructor" properties. Also + calls setParent and setPrototype with appropriate values. + Then adds the function object as a property of the given scope, using + prototype.getClassName() + as the name of the property. +

+

+
Parameters:
scope - the scope in which to define the constructor (typically + the global object)
prototype - the prototype object
See Also:
Scriptable.setParentScope(org.mozilla.javascript.Scriptable), +Scriptable.setPrototype(org.mozilla.javascript.Scriptable), +Scriptable.getClassName()
+
+
+
+ +

+convertArg

+
+public static java.lang.Object convertArg(Context cx,
+                                          Scriptable scope,
+                                          java.lang.Object arg,
+                                          java.lang.Class desired)
+
+
Deprecated. Use getTypeTag(Class) + and convertArg(Context, Scriptable, Object, int) + for type convertion. +

+

+
+
+
+
+ +

+call

+
+public java.lang.Object call(Context cx,
+                             Scriptable scope,
+                             Scriptable thisObj,
+                             java.lang.Object[] args)
+
+
Performs conversions on argument types if needed and + invokes the underlying Java method or constructor. +

+ Implements Function.call. +

+

+
Specified by:
call in interface Callable
Specified by:
call in interface Function
Overrides:
call in class org.mozilla.javascript.BaseFunction
+
+
+
Parameters:
cx - the current Context for this thread
scope - the scope to execute the function relative to. This is + set to the value returned by getParentScope() except + when the function is called from a closure.
thisObj - the JavaScript this object
args - the array of arguments +
Returns:
the result of the call
See Also:
Function.call( + Context, Scriptable, Scriptable, Object[])
+
+
+
+ +

+createObject

+
+public Scriptable createObject(Context cx,
+                               Scriptable scope)
+
+
Return new Scriptable instance using the default + constructor for the class of the underlying Java method. + Return null to indicate that the call method should be used to create + new objects. +

+

+
Overrides:
createObject in class org.mozilla.javascript.BaseFunction
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html new file mode 100644 index 0000000..2d998ac --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/GeneratedClassLoader.html @@ -0,0 +1,236 @@ + + + + + + +GeneratedClassLoader (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface GeneratedClassLoader

+
+
+
public interface GeneratedClassLoader
+ + +

+Interface to define classes from generated byte code. +

+ +

+


+ +

+ + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ClassdefineClass(java.lang.String name, + byte[] data) + +
+          Define a new Java class.
+ voidlinkClass(java.lang.Class cl) + +
+          Link the given class.
+  +

+ + + + + + + + +
+Method Detail
+ +

+defineClass

+
+java.lang.Class defineClass(java.lang.String name,
+                            byte[] data)
+
+
Define a new Java class. + Classes created via this method should have the same class loader. +

+

+
Parameters:
name - fully qualified class name
data - class byte code +
Returns:
new class object
+
+
+
+ +

+linkClass

+
+void linkClass(java.lang.Class cl)
+
+
Link the given class. +

+

+
Parameters:
cl - Class instance returned from the previous call to + defineClass(String, byte[])
See Also:
ClassLoader
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html new file mode 100644 index 0000000..78dd7a7 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ImporterTopLevel.html @@ -0,0 +1,583 @@ + + + + + + +ImporterTopLevel (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class ImporterTopLevel

+
+java.lang.Object
+  extended by org.mozilla.javascript.ScriptableObject
+      extended by org.mozilla.javascript.IdScriptableObject
+          extended by org.mozilla.javascript.ImporterTopLevel
+
+
+
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.IdFunctionCall, Scriptable
+
+
+
+
public class ImporterTopLevel
extends org.mozilla.javascript.IdScriptableObject
+ + +

+Class ImporterTopLevel + + This class defines a ScriptableObject that can be instantiated + as a top-level ("global") object to provide functionality similar + to Java's "import" statement. +

+ This class can be used to create a top-level scope using the following code: +

+  Scriptable scope = new ImporterTopLevel(cx);
+ 
+ Then JavaScript code will have access to the following methods: + + The following code from the shell illustrates this use: +
+ js> importClass(java.io.File)
+ js> f = new File('help.txt')
+ help.txt
+ js> importPackage(java.util)
+ js> v = new Vector()
+ []
+

+ +

+

+
Author:
+
Norris Boyd
+
See Also:
Serialized Form
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
+ + + + + + + +
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
+  + + + + + + + + + + + + + + + + +
+Constructor Summary
ImporterTopLevel() + +
+           
ImporterTopLevel(Context cx) + +
+           
ImporterTopLevel(Context cx, + boolean sealed) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ObjectexecIdCall(org.mozilla.javascript.IdFunctionObject f, + Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          'thisObj' will be null if invoked as constructor, in which case + instance of Scriptable should be returned.
+protected  intfindPrototypeId(java.lang.String s) + +
+           
+ java.lang.Objectget(java.lang.String name, + Scriptable start) + +
+          Returns the value of the named property or NOT_FOUND.
+ java.lang.StringgetClassName() + +
+          Return the name of the class.
+ booleanhas(java.lang.String name, + Scriptable start) + +
+          Returns true if the named property is defined.
+ voidimportPackage(Context cx, + Scriptable thisObj, + java.lang.Object[] args, + Function funObj) + +
+          Deprecated. Kept only for compatibility.
+static voidinit(Context cx, + Scriptable scope, + boolean sealed) + +
+           
+protected  voidinitPrototypeId(int id) + +
+           
+ voidinitStandardObjects(Context cx, + boolean sealed) + +
+           
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdValue
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ImporterTopLevel

+
+public ImporterTopLevel()
+
+
+
+ +

+ImporterTopLevel

+
+public ImporterTopLevel(Context cx)
+
+
+
+ +

+ImporterTopLevel

+
+public ImporterTopLevel(Context cx,
+                        boolean sealed)
+
+
+ + + + + + + + +
+Method Detail
+ +

+getClassName

+
+public java.lang.String getClassName()
+
+
Description copied from class: ScriptableObject
+
Return the name of the class. + + This is typically the same name as the constructor. + Classes extending ScriptableObject must implement this abstract + method. +

+

+
Specified by:
getClassName in interface Scriptable
Specified by:
getClassName in class ScriptableObject
+
+
+
+
+
+
+ +

+init

+
+public static void init(Context cx,
+                        Scriptable scope,
+                        boolean sealed)
+
+
+
+
+
+
+ +

+initStandardObjects

+
+public void initStandardObjects(Context cx,
+                                boolean sealed)
+
+
+
+
+
+
+ +

+has

+
+public boolean has(java.lang.String name,
+                   Scriptable start)
+
+
Description copied from class: ScriptableObject
+
Returns true if the named property is defined. +

+

+
Specified by:
has in interface Scriptable
Overrides:
has in class org.mozilla.javascript.IdScriptableObject
+
+
+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
true if and only if the property was found in the object
See Also:
Scriptable.get(String, Scriptable), +ScriptableObject.getProperty(Scriptable, String)
+
+
+
+ +

+get

+
+public java.lang.Object get(java.lang.String name,
+                            Scriptable start)
+
+
Description copied from class: ScriptableObject
+
Returns the value of the named property or NOT_FOUND. + + If the property was created using defineProperty, the + appropriate getter method is called. +

+

+
Specified by:
get in interface Scriptable
Overrides:
get in class org.mozilla.javascript.IdScriptableObject
+
+
+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
the value of the property (may be null), or NOT_FOUND
See Also:
Context.getUndefinedValue()
+
+
+
+ +

+importPackage

+
+public void importPackage(Context cx,
+                          Scriptable thisObj,
+                          java.lang.Object[] args,
+                          Function funObj)
+
+
Deprecated. Kept only for compatibility. +

+

+
+
+
+
+ +

+initPrototypeId

+
+protected void initPrototypeId(int id)
+
+
+
Overrides:
initPrototypeId in class org.mozilla.javascript.IdScriptableObject
+
+
+
+
+
+
+ +

+execIdCall

+
+public java.lang.Object execIdCall(org.mozilla.javascript.IdFunctionObject f,
+                                   Context cx,
+                                   Scriptable scope,
+                                   Scriptable thisObj,
+                                   java.lang.Object[] args)
+
+
Description copied from class: org.mozilla.javascript.IdScriptableObject
+
'thisObj' will be null if invoked as constructor, in which case + instance of Scriptable should be returned. +

+

+
Specified by:
execIdCall in interface org.mozilla.javascript.IdFunctionCall
Overrides:
execIdCall in class org.mozilla.javascript.IdScriptableObject
+
+
+
+
+
+
+ +

+findPrototypeId

+
+protected int findPrototypeId(java.lang.String s)
+
+
+
Overrides:
findPrototypeId in class org.mozilla.javascript.IdScriptableObject
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html new file mode 100644 index 0000000..6dafa13 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/JavaScriptException.html @@ -0,0 +1,375 @@ + + + + + + +JavaScriptException (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class JavaScriptException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by java.lang.RuntimeException
+              extended by org.mozilla.javascript.RhinoException
+                  extended by org.mozilla.javascript.JavaScriptException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class JavaScriptException
extends RhinoException
+
+ +

+Java reflection of JavaScript exceptions. + Instances of this class are thrown by the JavaScript 'throw' keyword. +

+ +

+

+
Author:
+
Mike McCabe
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + +
+Constructor Summary
JavaScriptException(java.lang.Object value) + +
+          Deprecated. Use WrappedException.WrappedException(Throwable) to report + exceptions in Java code.
JavaScriptException(java.lang.Object value, + java.lang.String sourceName, + int lineNumber) + +
+          Create a JavaScript exception wrapping the given JavaScript value
+  + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.Stringdetails() + +
+           
+ intgetLineNumber() + +
+          Deprecated. Use RhinoException.lineNumber() from the super class.
+ java.lang.StringgetSourceName() + +
+          Deprecated. Use RhinoException.sourceName() from the super class.
+ java.lang.ObjectgetValue() + +
+           
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.RhinoException
columnNumber, getMessage, getScriptStackTrace, getScriptStackTrace, initColumnNumber, initLineNumber, initLineSource, initSourceName, lineNumber, lineSource, printStackTrace, printStackTrace, sourceName
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+JavaScriptException

+
+public JavaScriptException(java.lang.Object value)
+
+
Deprecated. Use WrappedException.WrappedException(Throwable) to report + exceptions in Java code. +

+

+
+ +

+JavaScriptException

+
+public JavaScriptException(java.lang.Object value,
+                           java.lang.String sourceName,
+                           int lineNumber)
+
+
Create a JavaScript exception wrapping the given JavaScript value +

+

+
Parameters:
value - the JavaScript value thrown.
+
+ + + + + + + + +
+Method Detail
+ +

+details

+
+public java.lang.String details()
+
+
+
Overrides:
details in class RhinoException
+
+
+
+
+
+
+ +

+getValue

+
+public java.lang.Object getValue()
+
+
+ +
Returns:
the value wrapped by this exception
+
+
+
+ +

+getSourceName

+
+public java.lang.String getSourceName()
+
+
Deprecated. Use RhinoException.sourceName() from the super class. +

+

+
+
+
+
+ +

+getLineNumber

+
+public int getLineNumber()
+
+
Deprecated. Use RhinoException.lineNumber() from the super class. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html new file mode 100644 index 0000000..910d0fd --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RefCallable.html @@ -0,0 +1,233 @@ + + + + + + +RefCallable (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface RefCallable

+
+
All Superinterfaces:
Callable
+
+
+
+
public interface RefCallable
extends Callable
+ + +

+Object that can allows assignments to the result of function calls. +

+ +

+


+ +

+ + + + + + + + + + + + +
+Method Summary
+ org.mozilla.javascript.RefrefCall(Context cx, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Perform function call in reference context.
+ + + + + + + +
Methods inherited from interface org.mozilla.javascript.Callable
call
+  +

+ + + + + + + + +
+Method Detail
+ +

+refCall

+
+org.mozilla.javascript.Ref refCall(Context cx,
+                                   Scriptable thisObj,
+                                   java.lang.Object[] args)
+
+
Perform function call in reference context. + The args array reference should not be stored in any object that is + can be GC-reachable after this method returns. If this is necessary, + for example, to implement Ref methods, then store args.clone(), + not args array itself. +

+

+
+
+
+
Parameters:
cx - the current Context for this thread
thisObj - the JavaScript this object
args - the array of arguments
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html new file mode 100644 index 0000000..4ad3d0f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/RhinoException.html @@ -0,0 +1,544 @@ + + + + + + +RhinoException (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class RhinoException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by java.lang.RuntimeException
+              extended by org.mozilla.javascript.RhinoException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
Direct Known Subclasses:
EcmaError, EvaluatorException, JavaScriptException
+
+
+
+
public abstract class RhinoException
extends java.lang.RuntimeException
+ + +

+The class of exceptions thrown by the JavaScript engine. +

+ +

+

+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ intcolumnNumber() + +
+          The column number of the location of the error, or zero if unknown.
+ java.lang.Stringdetails() + +
+           
+ java.lang.StringgetMessage() + +
+           
+ java.lang.StringgetScriptStackTrace() + +
+          Get a string representing the script stack of this exception.
+ java.lang.StringgetScriptStackTrace(java.io.FilenameFilter filter) + +
+          Get a string representing the script stack of this exception.
+ voidinitColumnNumber(int columnNumber) + +
+          Initialize the column number of the script statement causing the error.
+ voidinitLineNumber(int lineNumber) + +
+          Initialize the line number of the script statement causing the error.
+ voidinitLineSource(java.lang.String lineSource) + +
+          Initialize the text of the source line containing the error.
+ voidinitSourceName(java.lang.String sourceName) + +
+          Initialize the uri of the script source containing the error.
+ intlineNumber() + +
+          Returns the line number of the statement causing the error, + or zero if not available.
+ java.lang.StringlineSource() + +
+          The source text of the line causing the error, or null if unknown.
+ voidprintStackTrace(java.io.PrintStream s) + +
+           
+ voidprintStackTrace(java.io.PrintWriter s) + +
+           
+ java.lang.StringsourceName() + +
+          Get the uri of the script source containing the error, or null + if that information is not available.
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Method Detail
+ +

+getMessage

+
+public final java.lang.String getMessage()
+
+
+
Overrides:
getMessage in class java.lang.Throwable
+
+
+
+
+
+
+ +

+details

+
+public java.lang.String details()
+
+
+
+
+
+
+ +

+sourceName

+
+public final java.lang.String sourceName()
+
+
Get the uri of the script source containing the error, or null + if that information is not available. +

+

+
+
+
+
+ +

+initSourceName

+
+public final void initSourceName(java.lang.String sourceName)
+
+
Initialize the uri of the script source containing the error. +

+

+
Parameters:
sourceName - the uri of the script source responsible for the error. + It should not be null. +
Throws: +
java.lang.IllegalStateException - if the method is called more then once.
+
+
+
+ +

+lineNumber

+
+public final int lineNumber()
+
+
Returns the line number of the statement causing the error, + or zero if not available. +

+

+
+
+
+
+ +

+initLineNumber

+
+public final void initLineNumber(int lineNumber)
+
+
Initialize the line number of the script statement causing the error. +

+

+
Parameters:
lineNumber - the line number in the script source. + It should be positive number. +
Throws: +
java.lang.IllegalStateException - if the method is called more then once.
+
+
+
+ +

+columnNumber

+
+public final int columnNumber()
+
+
The column number of the location of the error, or zero if unknown. +

+

+
+
+
+
+ +

+initColumnNumber

+
+public final void initColumnNumber(int columnNumber)
+
+
Initialize the column number of the script statement causing the error. +

+

+
Parameters:
columnNumber - the column number in the script source. + It should be positive number. +
Throws: +
java.lang.IllegalStateException - if the method is called more then once.
+
+
+
+ +

+lineSource

+
+public final java.lang.String lineSource()
+
+
The source text of the line causing the error, or null if unknown. +

+

+
+
+
+
+ +

+initLineSource

+
+public final void initLineSource(java.lang.String lineSource)
+
+
Initialize the text of the source line containing the error. +

+

+
Parameters:
lineSource - the text of the source line responsible for the error. + It should not be null. +
Throws: +
java.lang.IllegalStateException - if the method is called more then once.
+
+
+
+ +

+getScriptStackTrace

+
+public java.lang.String getScriptStackTrace()
+
+
Get a string representing the script stack of this exception. + If optimization is enabled, this corresponds to all java stack elements + with a source name ending with ".js". +

+

+ +
Returns:
a script stack dump
Since:
+
1.6R6
+
+
+
+
+ +

+getScriptStackTrace

+
+public java.lang.String getScriptStackTrace(java.io.FilenameFilter filter)
+
+
Get a string representing the script stack of this exception. + If optimization is enabled, this corresponds to all java stack elements + with a source name matching the filter. +

+

+
Parameters:
filter - the file name filter to determine whether a file is a + script file +
Returns:
a script stack dump
Since:
+
1.6R6
+
+
+
+
+ +

+printStackTrace

+
+public void printStackTrace(java.io.PrintWriter s)
+
+
+
Overrides:
printStackTrace in class java.lang.Throwable
+
+
+
+
+
+
+ +

+printStackTrace

+
+public void printStackTrace(java.io.PrintStream s)
+
+
+
Overrides:
printStackTrace in class java.lang.Throwable
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html new file mode 100644 index 0000000..65f250f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Script.html @@ -0,0 +1,231 @@ + + + + + + +Script (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface Script

+
+
+
public interface Script
+ + +

+All compiled scripts implement this interface. +

+ This class encapsulates script execution relative to an + object scope. +

+ +

+

+
Since:
+
1.3
+
Author:
+
Norris Boyd
+
+
+ +

+ + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectexec(Context cx, + Scriptable scope) + +
+          Execute the script.
+  +

+ + + + + + + + +
+Method Detail
+ +

+exec

+
+java.lang.Object exec(Context cx,
+                      Scriptable scope)
+
+
Execute the script. +

+ The script is executed in a particular runtime Context, which + must be associated with the current thread. + The script is executed relative to a scope--definitions and + uses of global top-level variables and functions will access + properties of the scope object. For compliant ECMA + programs, the scope must be an object that has been initialized + as a global object using Context.initStandardObjects. +

+

+

+
Parameters:
cx - the Context associated with the current thread
scope - the scope to execute relative to +
Returns:
the result of executing the script
See Also:
Context.initStandardObjects()
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html new file mode 100644 index 0000000..14ab7aa --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Scriptable.html @@ -0,0 +1,756 @@ + + + + + + +Scriptable (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface Scriptable

+
+
All Known Subinterfaces:
Function
+
+
+
All Known Implementing Classes:
org.mozilla.javascript.BaseFunction, org.mozilla.javascript.Delegator, FunctionObject, org.mozilla.javascript.IdScriptableObject, ImporterTopLevel, ScriptableObject, Synchronizer
+
+
+
+
public interface Scriptable
+ + +

+This is interface that all objects in JavaScript must implement. + The interface provides for the management of properties and for + performing conversions. +

+ Host system implementors may find it easier to extend the ScriptableObject + class rather than implementing Scriptable when writing host objects. +

+ There are many static methods defined in ScriptableObject that perform + the multiple calls to the Scriptable interface needed in order to + manipulate properties in prototype chains. +

+

+ +

+

+
Author:
+
Norris Boyd, Nick Thompson, Brendan Eich
+
See Also:
ScriptableObject
+
+ +

+ + + + + + + + + + + +
+Field Summary
+static java.lang.ObjectNOT_FOUND + +
+          Value returned from get if the property is not + found.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voiddelete(int index) + +
+          Removes a property from this object.
+ voiddelete(java.lang.String name) + +
+          Removes a property from this object.
+ java.lang.Objectget(int index, + Scriptable start) + +
+          Get a property from the object selected by an integral index.
+ java.lang.Objectget(java.lang.String name, + Scriptable start) + +
+          Get a named property from the object.
+ java.lang.StringgetClassName() + +
+          Get the name of the set of objects implemented by this Java class.
+ java.lang.ObjectgetDefaultValue(java.lang.Class hint) + +
+          Get the default value of the object with a given hint.
+ java.lang.Object[]getIds() + +
+          Get an array of property ids.
+ ScriptablegetParentScope() + +
+          Get the parent scope of the object.
+ ScriptablegetPrototype() + +
+          Get the prototype of the object.
+ booleanhas(int index, + Scriptable start) + +
+          Indicates whether or not an indexed property is defined in an object.
+ booleanhas(java.lang.String name, + Scriptable start) + +
+          Indicates whether or not a named property is defined in an object.
+ booleanhasInstance(Scriptable instance) + +
+          The instanceof operator.
+ voidput(int index, + Scriptable start, + java.lang.Object value) + +
+          Sets an indexed property in this object.
+ voidput(java.lang.String name, + Scriptable start, + java.lang.Object value) + +
+          Sets a named property in this object.
+ voidsetParentScope(Scriptable parent) + +
+          Set the parent scope of the object.
+ voidsetPrototype(Scriptable prototype) + +
+          Set the prototype of the object.
+  +

+ + + + + + + + +
+Field Detail
+ +

+NOT_FOUND

+
+static final java.lang.Object NOT_FOUND
+
+
Value returned from get if the property is not + found. +

+

+
+
+ + + + + + + + +
+Method Detail
+ +

+getClassName

+
+java.lang.String getClassName()
+
+
Get the name of the set of objects implemented by this Java class. + This corresponds to the [[Class]] operation in ECMA and is used + by Object.prototype.toString() in ECMA.

+ See ECMA 8.6.2 and 15.2.4.2. +

+

+
+
+
+
+ +

+get

+
+java.lang.Object get(java.lang.String name,
+                     Scriptable start)
+
+
Get a named property from the object. + + Looks property up in this object and returns the associated value + if found. Returns NOT_FOUND if not found. + Note that this method is not expected to traverse the prototype + chain. This is different from the ECMA [[Get]] operation. + + Depending on the property selector, the runtime will call + this method or the form of get that takes an + integer: + + + + + + + + + + +
JavaScript codeJava code
a.b a.get("b", a)
a["foo"] a.get("foo", a)
a[3] a.get(3, a)
a["3"] a.get(3, a)
a[3.0] a.get(3, a)
a["3.0"] a.get("3.0", a)
a[1.1] a.get("1.1", a)
a[-4] a.get(-4, a)
+

+ The values that may be returned are limited to the following: +

    +
  • java.lang.Boolean objects
  • +
  • java.lang.String objects
  • +
  • java.lang.Number objects
  • +
  • org.mozilla.javascript.Scriptable objects
  • +
  • null
  • +
  • The value returned by Context.getUndefinedValue()
  • +
  • NOT_FOUND
  • +
+

+

+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
the value of the property (may be null), or NOT_FOUND
See Also:
Context.getUndefinedValue()
+
+
+
+ +

+get

+
+java.lang.Object get(int index,
+                     Scriptable start)
+
+
Get a property from the object selected by an integral index. + + Identical to get(String, Scriptable) except that + an integral index is used to select the property. +

+

+
Parameters:
index - the numeric index for the property
start - the object in which the lookup began +
Returns:
the value of the property (may be null), or NOT_FOUND
See Also:
get(String,Scriptable)
+
+
+
+ +

+has

+
+boolean has(java.lang.String name,
+            Scriptable start)
+
+
Indicates whether or not a named property is defined in an object. + + Does not traverse the prototype chain.

+ + The property is specified by a String name + as defined for the get method.

+

+

+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
true if and only if the named property is found in the object
See Also:
get(String, Scriptable), +ScriptableObject.getProperty(Scriptable, String)
+
+
+
+ +

+has

+
+boolean has(int index,
+            Scriptable start)
+
+
Indicates whether or not an indexed property is defined in an object. + + Does not traverse the prototype chain.

+ + The property is specified by an integral index + as defined for the get method.

+

+

+
Parameters:
index - the numeric index for the property
start - the object in which the lookup began +
Returns:
true if and only if the indexed property is found in the object
See Also:
get(int, Scriptable), +ScriptableObject.getProperty(Scriptable, int)
+
+
+
+ +

+put

+
+void put(java.lang.String name,
+         Scriptable start,
+         java.lang.Object value)
+
+
Sets a named property in this object. +

+ The property is specified by a string name + as defined for get. +

+ The possible values that may be passed in are as defined for + get. A class that implements this method may choose + to ignore calls to set certain properties, in which case those + properties are effectively read-only.

+ For properties defined in a prototype chain, + use putProperty in ScriptableObject.

+ Note that if a property a is defined in the prototype p + of an object o, then evaluating o.a = 23 will cause + set to be called on the prototype p with + o as the start parameter. + To preserve JavaScript semantics, it is the Scriptable + object's responsibility to modify o.

+ This design allows properties to be defined in prototypes and implemented + in terms of getters and setters of Java values without consuming slots + in each instance.

+

+ The values that may be set are limited to the following: +

    +
  • java.lang.Boolean objects
  • +
  • java.lang.String objects
  • +
  • java.lang.Number objects
  • +
  • org.mozilla.javascript.Scriptable objects
  • +
  • null
  • +
  • The value returned by Context.getUndefinedValue()
  • +

+ Arbitrary Java objects may be wrapped in a Scriptable by first calling + Context.toObject. This allows the property of a JavaScript + object to contain an arbitrary Java object as a value.

+ Note that has will be called by the runtime first before + set is called to determine in which object the + property is defined. + Note that this method is not expected to traverse the prototype chain, + which is different from the ECMA [[Put]] operation. +

+

+
Parameters:
name - the name of the property
start - the object whose property is being set
value - value to set the property to
See Also:
has(String, Scriptable), +get(String, Scriptable), +ScriptableObject.putProperty(Scriptable, String, Object), +Context.toObject(Object, Scriptable)
+
+
+
+ +

+put

+
+void put(int index,
+         Scriptable start,
+         java.lang.Object value)
+
+
Sets an indexed property in this object. +

+ The property is specified by an integral index + as defined for get.

+ + Identical to put(String, Scriptable, Object) except that + an integral index is used to select the property. +

+

+
Parameters:
index - the numeric index for the property
start - the object whose property is being set
value - value to set the property to
See Also:
has(int, Scriptable), +get(int, Scriptable), +ScriptableObject.putProperty(Scriptable, int, Object), +Context.toObject(Object, Scriptable)
+
+
+
+ +

+delete

+
+void delete(java.lang.String name)
+
+
Removes a property from this object. + This operation corresponds to the ECMA [[Delete]] except that + the no result is returned. The runtime will guarantee that this + method is called only if the property exists. After this method + is called, the runtime will call Scriptable.has to see if the + property has been removed in order to determine the boolean + result of the delete operator as defined by ECMA 11.4.1. +

+ A property can be made permanent by ignoring calls to remove + it.

+ The property is specified by a String name + as defined for get. +

+ To delete properties defined in a prototype chain, + see deleteProperty in ScriptableObject. +

+

+
Parameters:
name - the identifier for the property
See Also:
get(String, Scriptable), +ScriptableObject.deleteProperty(Scriptable, String)
+
+
+
+ +

+delete

+
+void delete(int index)
+
+
Removes a property from this object. + + The property is specified by an integral index + as defined for get. +

+ To delete properties defined in a prototype chain, + see deleteProperty in ScriptableObject. + + Identical to delete(String) except that + an integral index is used to select the property. +

+

+
Parameters:
index - the numeric index for the property
See Also:
get(int, Scriptable), +ScriptableObject.deleteProperty(Scriptable, int)
+
+
+
+ +

+getPrototype

+
+Scriptable getPrototype()
+
+
Get the prototype of the object. +

+

+ +
Returns:
the prototype
+
+
+
+ +

+setPrototype

+
+void setPrototype(Scriptable prototype)
+
+
Set the prototype of the object. +

+

+
Parameters:
prototype - the prototype to set
+
+
+
+ +

+getParentScope

+
+Scriptable getParentScope()
+
+
Get the parent scope of the object. +

+

+ +
Returns:
the parent scope
+
+
+
+ +

+setParentScope

+
+void setParentScope(Scriptable parent)
+
+
Set the parent scope of the object. +

+

+
Parameters:
parent - the parent scope to set
+
+
+
+ +

+getIds

+
+java.lang.Object[] getIds()
+
+
Get an array of property ids. + + Not all property ids need be returned. Those properties + whose ids are not returned are considered non-enumerable. +

+

+ +
Returns:
an array of Objects. Each entry in the array is either + a java.lang.String or a java.lang.Number
+
+
+
+ +

+getDefaultValue

+
+java.lang.Object getDefaultValue(java.lang.Class hint)
+
+
Get the default value of the object with a given hint. + The hints are String.class for type String, Number.class for type + Number, Scriptable.class for type Object, and Boolean.class for + type Boolean.

+ + A hint of null means "no hint". + + See ECMA 8.6.2.6. +

+

+
Parameters:
hint - the type hint +
Returns:
the default value
+
+
+
+ +

+hasInstance

+
+boolean hasInstance(Scriptable instance)
+
+
The instanceof operator. + +

+ The JavaScript code "lhs instanceof rhs" causes rhs.hasInstance(lhs) to + be called. + +

+ The return value is implementation dependent so that embedded host objects can + return an appropriate value. See the JS 1.3 language documentation for more + detail. + +

This operator corresponds to the proposed EMCA [[HasInstance]] operator. +

+

+
Parameters:
instance - The value that appeared on the LHS of the instanceof + operator +
Returns:
an implementation dependent value
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html new file mode 100644 index 0000000..fce83d6 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ScriptableObject.html @@ -0,0 +1,2604 @@ + + + + + + +ScriptableObject (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class ScriptableObject

+
+java.lang.Object
+  extended by org.mozilla.javascript.ScriptableObject
+
+
+
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, Scriptable
+
+
+
Direct Known Subclasses:
org.mozilla.javascript.IdScriptableObject
+
+
+
+
public abstract class ScriptableObject
extends java.lang.Object
implements Scriptable, java.io.Serializable, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.ConstProperties
+ + +

+This is the default implementation of the Scriptable interface. This + class provides convenient default behavior that makes it easier to + define host objects. +

+ Various properties and methods of JavaScript objects can be conveniently + defined using methods of ScriptableObject. +

+ Classes extending ScriptableObject must define the getClassName method. +

+ +

+

+
Author:
+
Norris Boyd
+
See Also:
Scriptable, +Serialized Form
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Field Summary
+static intCONST + +
+           
+static intDONTENUM + +
+          Property attribute indicating property is not enumerated.
+static intEMPTY + +
+          The empty property attribute.
+static intPERMANENT + +
+          Property attribute indicating property cannot be deleted.
+static intREADONLY + +
+          Property attribute indicating assignment to this property is ignored.
+static intUNINITIALIZED_CONST + +
+          Property attribute indicating that this is a const property that has not + been assigned yet.
+ + + + + + + +
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
+  + + + + + + + + + + + + + +
+Constructor Summary
ScriptableObject() + +
+           
ScriptableObject(Scriptable scope, + Scriptable prototype) + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ObjectassociateValue(java.lang.Object key, + java.lang.Object value) + +
+          Associate arbitrary application-specific value with this object.
+ booleanavoidObjectDetection() + +
+          Emulate the SpiderMonkey (and Firefox) feature of allowing + custom objects to avoid detection by normal "object detection" + code patterns.
+static java.lang.ObjectcallMethod(Context cx, + Scriptable obj, + java.lang.String methodName, + java.lang.Object[] args) + +
+          Call a method of an object.
+static java.lang.ObjectcallMethod(Scriptable obj, + java.lang.String methodName, + java.lang.Object[] args) + +
+          Call a method of an object.
+static voiddefineClass(Scriptable scope, + java.lang.Class clazz) + +
+          Defines JavaScript objects from a Java class that implements Scriptable.
+static voiddefineClass(Scriptable scope, + java.lang.Class clazz, + boolean sealed) + +
+          Defines JavaScript objects from a Java class, optionally + allowing sealing.
+static java.lang.StringdefineClass(Scriptable scope, + java.lang.Class clazz, + boolean sealed, + boolean mapInheritance) + +
+          Defines JavaScript objects from a Java class, optionally + allowing sealing and mapping of Java inheritance to JavaScript + prototype-based inheritance.
+ voiddefineConst(java.lang.String name, + Scriptable start) + +
+          Reserves a definition spot for a const.
+static voiddefineConstProperty(Scriptable destination, + java.lang.String propertyName) + +
+          Utility method to add properties to arbitrary Scriptable object.
+ voiddefineFunctionProperties(java.lang.String[] names, + java.lang.Class clazz, + int attributes) + +
+          Search for names in a class, adding the resulting methods + as properties.
+static voiddefineProperty(Scriptable destination, + java.lang.String propertyName, + java.lang.Object value, + int attributes) + +
+          Utility method to add properties to arbitrary Scriptable object.
+ voiddefineProperty(java.lang.String propertyName, + java.lang.Class clazz, + int attributes) + +
+          Define a JavaScript property with getter and setter side effects.
+ voiddefineProperty(java.lang.String propertyName, + java.lang.Object value, + int attributes) + +
+          Define a JavaScript property.
+ voiddefineProperty(java.lang.String propertyName, + java.lang.Object delegateTo, + java.lang.reflect.Method getter, + java.lang.reflect.Method setter, + int attributes) + +
+          Define a JavaScript property.
+ voiddelete(int index) + +
+          Removes the indexed property from the object.
+ voiddelete(java.lang.String name) + +
+          Removes a named property from the object.
+static booleandeleteProperty(Scriptable obj, + int index) + +
+          Removes the property from an object or its prototype chain.
+static booleandeleteProperty(Scriptable obj, + java.lang.String name) + +
+          Removes the property from an object or its prototype chain.
+protected  java.lang.ObjectequivalentValues(java.lang.Object value) + +
+          Custom == operator.
+ java.lang.Objectget(int index, + Scriptable start) + +
+          Returns the value of the indexed property or NOT_FOUND.
+ java.lang.Objectget(java.lang.String name, + Scriptable start) + +
+          Returns the value of the named property or NOT_FOUND.
+ java.lang.Object[]getAllIds() + +
+          Returns an array of ids for the properties of the object.
+ java.lang.ObjectgetAssociatedValue(java.lang.Object key) + +
+          Get arbitrary application-specific value associated with this object.
+ intgetAttributes(int index) + +
+          Get the attributes of an indexed property.
+ intgetAttributes(int index, + Scriptable start) + +
+          Deprecated. Use getAttributes(int index). The engine always + ignored the start argument.
+ intgetAttributes(java.lang.String name) + +
+          Get the attributes of a named property.
+ intgetAttributes(java.lang.String name, + Scriptable start) + +
+          Deprecated. Use getAttributes(String name). The engine always + ignored the start argument.
+abstract  java.lang.StringgetClassName() + +
+          Return the name of the class.
+static ScriptablegetClassPrototype(Scriptable scope, + java.lang.String className) + +
+          Get the prototype for the named class.
+ java.lang.ObjectgetDefaultValue(java.lang.Class typeHint) + +
+          Implements the [[DefaultValue]] internal method.
+static java.lang.ObjectgetDefaultValue(Scriptable object, + java.lang.Class typeHint) + +
+           
+static ScriptablegetFunctionPrototype(Scriptable scope) + +
+          Get the Function.prototype property.
+ java.lang.ObjectgetGetterOrSetter(java.lang.String name, + int index, + boolean isSetter) + +
+          Get the getter or setter for a given property.
+ java.lang.Object[]getIds() + +
+          Returns an array of ids for the properties of the object.
+static ScriptablegetObjectPrototype(Scriptable scope) + +
+          Get the Object.prototype property.
+ ScriptablegetParentScope() + +
+          Returns the parent (enclosing) scope of the object.
+static java.lang.ObjectgetProperty(Scriptable obj, + int index) + +
+          Gets an indexed property from an object or any object in its prototype chain.
+static java.lang.ObjectgetProperty(Scriptable obj, + java.lang.String name) + +
+          Gets a named property from an object or any object in its prototype chain.
+static java.lang.Object[]getPropertyIds(Scriptable obj) + +
+          Returns an array of all ids from an object and its prototypes.
+ ScriptablegetPrototype() + +
+          Returns the prototype of the object.
+static ScriptablegetTopLevelScope(Scriptable obj) + +
+          Get the global scope.
+static java.lang.ObjectgetTopScopeValue(Scriptable scope, + java.lang.Object key) + +
+          Get arbitrary application-specific value associated with the top scope + of the given scope.
+ booleanhas(int index, + Scriptable start) + +
+          Returns true if the property index is defined.
+ booleanhas(java.lang.String name, + Scriptable start) + +
+          Returns true if the named property is defined.
+ booleanhasInstance(Scriptable instance) + +
+          Implements the instanceof operator.
+static booleanhasProperty(Scriptable obj, + int index) + +
+          Returns whether an indexed property is defined in an object or any object + in its prototype chain.
+static booleanhasProperty(Scriptable obj, + java.lang.String name) + +
+          Returns whether a named property is defined in an object or any object + in its prototype chain.
+ booleanisConst(java.lang.String name) + +
+          Returns true if the named property is defined as a const on this object.
+protected  booleanisGetterOrSetter(java.lang.String name, + int index, + boolean setter) + +
+          Returns whether a property is a getter or a setter
+ booleanisSealed() + +
+          Return true if this object is sealed.
+ voidput(int index, + Scriptable start, + java.lang.Object value) + +
+          Sets the value of the indexed property, creating it if need be.
+ voidput(java.lang.String name, + Scriptable start, + java.lang.Object value) + +
+          Sets the value of the named property, creating it if need be.
+ voidputConst(java.lang.String name, + Scriptable start, + java.lang.Object value) + +
+          Sets the value of the named const property, creating it if need be.
+static voidputConstProperty(Scriptable obj, + java.lang.String name, + java.lang.Object value) + +
+          Puts a named property in an object or in an object in its prototype chain.
+static voidputProperty(Scriptable obj, + int index, + java.lang.Object value) + +
+          Puts an indexed property in an object or in an object in its prototype chain.
+static voidputProperty(Scriptable obj, + java.lang.String name, + java.lang.Object value) + +
+          Puts a named property in an object or in an object in its prototype chain.
+static voidredefineProperty(Scriptable obj, + java.lang.String name, + boolean isConst) + +
+          If hasProperty(obj, name) would return true, then if the property that + was found is compatible with the new property, this method just returns.
+ voidsealObject() + +
+          Seal this object.
+ voidsetAttributes(int index, + int attributes) + +
+          Set the attributes of an indexed property.
+ voidsetAttributes(int index, + Scriptable start, + int attributes) + +
+          Deprecated. Use setAttributes(int index, int attributes). + The engine always ignored the start argument.
+ voidsetAttributes(java.lang.String name, + int attributes) + +
+          Set the attributes of a named property.
+ voidsetAttributes(java.lang.String name, + Scriptable start, + int attributes) + +
+          Deprecated. Use setAttributes(String name, int attributes). + The engine always ignored the start argument.
+ voidsetGetterOrSetter(java.lang.String name, + int index, + Callable getterOrSeter, + boolean isSetter) + +
+          XXX: write docs.
+ voidsetParentScope(Scriptable m) + +
+          Sets the parent (enclosing) scope of the object.
+ voidsetPrototype(Scriptable m) + +
+          Sets the prototype of the object.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+EMPTY

+
+public static final int EMPTY
+
+
The empty property attribute. + + Used by getAttributes() and setAttributes(). +

+

+
See Also:
getAttributes(String), +setAttributes(String, int), +Constant Field Values
+
+
+ +

+READONLY

+
+public static final int READONLY
+
+
Property attribute indicating assignment to this property is ignored. +

+

+
See Also:
#put(String, Scriptable, Object), +getAttributes(String), +setAttributes(String, int), +Constant Field Values
+
+
+ +

+DONTENUM

+
+public static final int DONTENUM
+
+
Property attribute indicating property is not enumerated. + + Only enumerated properties will be returned by getIds(). +

+

+
See Also:
getIds(), +getAttributes(String), +setAttributes(String, int), +Constant Field Values
+
+
+ +

+PERMANENT

+
+public static final int PERMANENT
+
+
Property attribute indicating property cannot be deleted. +

+

+
See Also:
delete(String), +getAttributes(String), +setAttributes(String, int), +Constant Field Values
+
+
+ +

+UNINITIALIZED_CONST

+
+public static final int UNINITIALIZED_CONST
+
+
Property attribute indicating that this is a const property that has not + been assigned yet. The first 'const' assignment to the property will + clear this bit. +

+

+
See Also:
Constant Field Values
+
+
+ +

+CONST

+
+public static final int CONST
+
+
+
See Also:
Constant Field Values
+
+ + + + + + + + +
+Constructor Detail
+ +

+ScriptableObject

+
+public ScriptableObject()
+
+
+
+ +

+ScriptableObject

+
+public ScriptableObject(Scriptable scope,
+                        Scriptable prototype)
+
+
+ + + + + + + + +
+Method Detail
+ +

+getClassName

+
+public abstract java.lang.String getClassName()
+
+
Return the name of the class. + + This is typically the same name as the constructor. + Classes extending ScriptableObject must implement this abstract + method. +

+

+
Specified by:
getClassName in interface Scriptable
+
+
+
+
+
+
+ +

+has

+
+public boolean has(java.lang.String name,
+                   Scriptable start)
+
+
Returns true if the named property is defined. +

+

+
Specified by:
has in interface Scriptable
+
+
+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
true if and only if the property was found in the object
See Also:
Scriptable.get(String, Scriptable), +getProperty(Scriptable, String)
+
+
+
+ +

+has

+
+public boolean has(int index,
+                   Scriptable start)
+
+
Returns true if the property index is defined. +

+

+
Specified by:
has in interface Scriptable
+
+
+
Parameters:
index - the numeric index for the property
start - the object in which the lookup began +
Returns:
true if and only if the property was found in the object
See Also:
Scriptable.get(int, Scriptable), +getProperty(Scriptable, int)
+
+
+
+ +

+get

+
+public java.lang.Object get(java.lang.String name,
+                            Scriptable start)
+
+
Returns the value of the named property or NOT_FOUND. + + If the property was created using defineProperty, the + appropriate getter method is called. +

+

+
Specified by:
get in interface Scriptable
+
+
+
Parameters:
name - the name of the property
start - the object in which the lookup began +
Returns:
the value of the property (may be null), or NOT_FOUND
See Also:
Context.getUndefinedValue()
+
+
+
+ +

+get

+
+public java.lang.Object get(int index,
+                            Scriptable start)
+
+
Returns the value of the indexed property or NOT_FOUND. +

+

+
Specified by:
get in interface Scriptable
+
+
+
Parameters:
index - the numeric index for the property
start - the object in which the lookup began +
Returns:
the value of the property (may be null), or NOT_FOUND
See Also:
Scriptable.get(String,Scriptable)
+
+
+
+ +

+put

+
+public void put(java.lang.String name,
+                Scriptable start,
+                java.lang.Object value)
+
+
Sets the value of the named property, creating it if need be. + + If the property was created using defineProperty, the + appropriate setter method is called.

+ + If the property's attributes include READONLY, no action is + taken. + This method will actually set the property in the start + object. +

+

+
Specified by:
put in interface Scriptable
+
+
+
Parameters:
name - the name of the property
start - the object whose property is being set
value - value to set the property to
See Also:
Scriptable.has(String, Scriptable), +Scriptable.get(String, Scriptable), +putProperty(Scriptable, String, Object), +Context.toObject(Object, Scriptable)
+
+
+
+ +

+put

+
+public void put(int index,
+                Scriptable start,
+                java.lang.Object value)
+
+
Sets the value of the indexed property, creating it if need be. +

+

+
Specified by:
put in interface Scriptable
+
+
+
Parameters:
index - the numeric index for the property
start - the object whose property is being set
value - value to set the property to
See Also:
Scriptable.has(int, Scriptable), +Scriptable.get(int, Scriptable), +putProperty(Scriptable, int, Object), +Context.toObject(Object, Scriptable)
+
+
+
+ +

+delete

+
+public void delete(java.lang.String name)
+
+
Removes a named property from the object. + + If the property is not found, or it has the PERMANENT attribute, + no action is taken. +

+

+
Specified by:
delete in interface Scriptable
+
+
+
Parameters:
name - the name of the property
See Also:
Scriptable.get(String, Scriptable), +deleteProperty(Scriptable, String)
+
+
+
+ +

+delete

+
+public void delete(int index)
+
+
Removes the indexed property from the object. + + If the property is not found, or it has the PERMANENT attribute, + no action is taken. +

+

+
Specified by:
delete in interface Scriptable
+
+
+
Parameters:
index - the numeric index for the property
See Also:
Scriptable.get(int, Scriptable), +deleteProperty(Scriptable, int)
+
+
+
+ +

+putConst

+
+public void putConst(java.lang.String name,
+                     Scriptable start,
+                     java.lang.Object value)
+
+
Sets the value of the named const property, creating it if need be. + + If the property was created using defineProperty, the + appropriate setter method is called.

+ + If the property's attributes include READONLY, no action is + taken. + This method will actually set the property in the start + object. +

+

+
Specified by:
putConst in interface org.mozilla.javascript.ConstProperties
+
+
+
Parameters:
name - the name of the property
start - the object whose property is being set
value - value to set the property to
See Also:
Scriptable.has(String, Scriptable), +Scriptable.get(String, Scriptable), +putProperty(Scriptable, String, Object), +Context.toObject(Object, Scriptable)
+
+
+
+ +

+defineConst

+
+public void defineConst(java.lang.String name,
+                        Scriptable start)
+
+
Description copied from interface: org.mozilla.javascript.ConstProperties
+
Reserves a definition spot for a const. This will set up a definition + of the const property, but set its value to undefined. The semantics of + the start parameter is the same as for putConst. +

+

+
Specified by:
defineConst in interface org.mozilla.javascript.ConstProperties
+
+
+
Parameters:
name - The name of the property.
start - The object whose property is being reserved.
+
+
+
+ +

+isConst

+
+public boolean isConst(java.lang.String name)
+
+
Returns true if the named property is defined as a const on this object. +

+

+
Specified by:
isConst in interface org.mozilla.javascript.ConstProperties
+
+
+
Parameters:
name - +
Returns:
true if the named property is defined as a const, false + otherwise.
+
+
+
+ +

+getAttributes

+
+public final int getAttributes(java.lang.String name,
+                               Scriptable start)
+
+
Deprecated. Use getAttributes(String name). The engine always + ignored the start argument. +

+

+
+
+
+
+
+
+
+ +

+getAttributes

+
+public final int getAttributes(int index,
+                               Scriptable start)
+
+
Deprecated. Use getAttributes(int index). The engine always + ignored the start argument. +

+

+
+
+
+
+
+
+
+ +

+setAttributes

+
+public final void setAttributes(java.lang.String name,
+                                Scriptable start,
+                                int attributes)
+
+
Deprecated. Use setAttributes(String name, int attributes). + The engine always ignored the start argument. +

+

+
+
+
+
+
+
+
+ +

+setAttributes

+
+public void setAttributes(int index,
+                          Scriptable start,
+                          int attributes)
+
+
Deprecated. Use setAttributes(int index, int attributes). + The engine always ignored the start argument. +

+

+
+
+
+
+
+
+
+ +

+getAttributes

+
+public int getAttributes(java.lang.String name)
+
+
Get the attributes of a named property. + + The property is specified by name + as defined for has.

+

+

+
+
+
+
Parameters:
name - the identifier for the property +
Returns:
the bitset of attributes +
Throws: +
EvaluatorException - if the named property is not found
See Also:
has(String, Scriptable), +READONLY, +DONTENUM, +PERMANENT, +EMPTY
+
+
+
+ +

+getAttributes

+
+public int getAttributes(int index)
+
+
Get the attributes of an indexed property. +

+

+
+
+
+
Parameters:
index - the numeric index for the property +
Returns:
the bitset of attributes +
Throws: +
EvaluatorException - if the named property is not found + is not found
See Also:
has(String, Scriptable), +READONLY, +DONTENUM, +PERMANENT, +EMPTY
+
+
+
+ +

+setAttributes

+
+public void setAttributes(java.lang.String name,
+                          int attributes)
+
+
Set the attributes of a named property. + + The property is specified by name + as defined for has.

+ + The possible attributes are READONLY, DONTENUM, + and PERMANENT. Combinations of attributes + are expressed by the bitwise OR of attributes. + EMPTY is the state of no attributes set. Any unused + bits are reserved for future use. +

+

+
+
+
+
Parameters:
name - the name of the property
attributes - the bitset of attributes +
Throws: +
EvaluatorException - if the named property is not found
See Also:
Scriptable.has(String, Scriptable), +READONLY, +DONTENUM, +PERMANENT, +EMPTY
+
+
+
+ +

+setAttributes

+
+public void setAttributes(int index,
+                          int attributes)
+
+
Set the attributes of an indexed property. +

+

+
+
+
+
Parameters:
index - the numeric index for the property
attributes - the bitset of attributes +
Throws: +
EvaluatorException - if the named property is not found
See Also:
Scriptable.has(String, Scriptable), +READONLY, +DONTENUM, +PERMANENT, +EMPTY
+
+
+
+ +

+setGetterOrSetter

+
+public void setGetterOrSetter(java.lang.String name,
+                              int index,
+                              Callable getterOrSeter,
+                              boolean isSetter)
+
+
XXX: write docs. +

+

+
+
+
+
+
+
+
+ +

+getGetterOrSetter

+
+public java.lang.Object getGetterOrSetter(java.lang.String name,
+                                          int index,
+                                          boolean isSetter)
+
+
Get the getter or setter for a given property. Used by __lookupGetter__ + and __lookupSetter__. +

+

+
+
+
+
Parameters:
name - Name of the object. If nonnull, index must be 0.
index - Index of the object. If nonzero, name must be null.
isSetter - If true, return the setter, otherwise return the getter. +
Returns:
Null if the property does not exist. Otherwise returns either + the getter or the setter for the property, depending on + the value of isSetter (may be undefined if unset). +
Throws: +
java.lang.IllegalArgumentException - if both name and index are nonnull + and nonzero respectively.
+
+
+
+ +

+isGetterOrSetter

+
+protected boolean isGetterOrSetter(java.lang.String name,
+                                   int index,
+                                   boolean setter)
+
+
Returns whether a property is a getter or a setter +

+

+
+
+
+
Parameters:
name - property name
index - property index
setter - true to check for a setter, false for a getter +
Returns:
whether the property is a getter or a setter
+
+
+
+ +

+getPrototype

+
+public Scriptable getPrototype()
+
+
Returns the prototype of the object. +

+

+
Specified by:
getPrototype in interface Scriptable
+
+
+ +
Returns:
the prototype
+
+
+
+ +

+setPrototype

+
+public void setPrototype(Scriptable m)
+
+
Sets the prototype of the object. +

+

+
Specified by:
setPrototype in interface Scriptable
+
+
+
Parameters:
m - the prototype to set
+
+
+
+ +

+getParentScope

+
+public Scriptable getParentScope()
+
+
Returns the parent (enclosing) scope of the object. +

+

+
Specified by:
getParentScope in interface Scriptable
+
+
+ +
Returns:
the parent scope
+
+
+
+ +

+setParentScope

+
+public void setParentScope(Scriptable m)
+
+
Sets the parent (enclosing) scope of the object. +

+

+
Specified by:
setParentScope in interface Scriptable
+
+
+
Parameters:
m - the parent scope to set
+
+
+
+ +

+getIds

+
+public java.lang.Object[] getIds()
+
+
Returns an array of ids for the properties of the object. + +

Any properties with the attribute DONTENUM are not listed.

+

+

+
Specified by:
getIds in interface Scriptable
+
+
+ +
Returns:
an array of java.lang.Objects with an entry for every + listed property. Properties accessed via an integer index will + have a corresponding + Integer entry in the returned array. Properties accessed by + a String will have a String entry in the returned array.
+
+
+
+ +

+getAllIds

+
+public java.lang.Object[] getAllIds()
+
+
Returns an array of ids for the properties of the object. + +

All properties, even those with attribute DONTENUM, are listed.

+

+

+
Specified by:
getAllIds in interface org.mozilla.javascript.debug.DebuggableObject
+
+
+ +
Returns:
an array of java.lang.Objects with an entry for every + listed property. Properties accessed via an integer index will + have a corresponding + Integer entry in the returned array. Properties accessed by + a String will have a String entry in the returned array.
+
+
+
+ +

+getDefaultValue

+
+public java.lang.Object getDefaultValue(java.lang.Class typeHint)
+
+
Implements the [[DefaultValue]] internal method. + +

Note that the toPrimitive conversion is a no-op for + every type other than Object, for which [[DefaultValue]] + is called. See ECMA 9.1.

+ + A hint of null means "no hint". +

+

+
Specified by:
getDefaultValue in interface Scriptable
+
+
+
Parameters:
typeHint - the type hint +
Returns:
the default value for the object + + See ECMA 8.6.2.6.
+
+
+
+ +

+getDefaultValue

+
+public static java.lang.Object getDefaultValue(Scriptable object,
+                                               java.lang.Class typeHint)
+
+
+
+
+
+
+
+
+
+ +

+hasInstance

+
+public boolean hasInstance(Scriptable instance)
+
+
Implements the instanceof operator. + +

This operator has been proposed to ECMA. +

+

+
Specified by:
hasInstance in interface Scriptable
+
+
+
Parameters:
instance - The value that appeared on the LHS of the instanceof + operator +
Returns:
true if "this" appears in value's prototype chain
+
+
+
+ +

+avoidObjectDetection

+
+public boolean avoidObjectDetection()
+
+
Emulate the SpiderMonkey (and Firefox) feature of allowing + custom objects to avoid detection by normal "object detection" + code patterns. This is used to implement document.all. + See https://bugzilla.mozilla.org/show_bug.cgi?id=412247. + This is an analog to JOF_DETECTING from SpiderMonkey; see + https://bugzilla.mozilla.org/show_bug.cgi?id=248549. + Other than this special case, embeddings should return false. +

+

+
+
+
+ +
Returns:
true if this object should avoid object detection
Since:
+
1.7R1
+
+
+
+
+ +

+equivalentValues

+
+protected java.lang.Object equivalentValues(java.lang.Object value)
+
+
Custom == operator. + Must return Scriptable.NOT_FOUND if this object does not + have custom equality operator for the given value, + Boolean.TRUE if this object is equivalent to value, + Boolean.FALSE if this object is not equivalent to + value. +

+ The default implementation returns Boolean.TRUE + if this == value or Scriptable.NOT_FOUND otherwise. + It indicates that by default custom equality is available only if + value is this in which case true is returned. +

+

+
+
+
+
+
+
+
+ +

+defineClass

+
+public static void defineClass(Scriptable scope,
+                               java.lang.Class clazz)
+                        throws java.lang.IllegalAccessException,
+                               java.lang.InstantiationException,
+                               java.lang.reflect.InvocationTargetException
+
+
Defines JavaScript objects from a Java class that implements Scriptable. + + If the given class has a method +
+ static void init(Context cx, Scriptable scope, boolean sealed);
+ + or its compatibility form +
+ static void init(Scriptable scope);
+ + then it is invoked and no further initialization is done.

+ + However, if no such a method is found, then the class's constructors and + methods are used to initialize a class in the following manner.

+ + First, the zero-parameter constructor of the class is called to + create the prototype. If no such constructor exists, + a EvaluatorException is thrown.

+ + Next, all methods are scanned for special prefixes that indicate that they + have special meaning for defining JavaScript objects. + These special prefixes are +

    +
  • jsFunction_ for a JavaScript function +
  • jsStaticFunction_ for a JavaScript function that + is a property of the constructor +
  • jsGet_ for a getter of a JavaScript property +
  • jsSet_ for a setter of a JavaScript property +
  • jsConstructor for a JavaScript function that + is the constructor +

+ + If the method's name begins with "jsFunction_", a JavaScript function + is created with a name formed from the rest of the Java method name + following "jsFunction_". So a Java method named "jsFunction_foo" will + define a JavaScript method "foo". Calling this JavaScript function + will cause the Java method to be called. The parameters of the method + must be of number and types as defined by the FunctionObject class. + The JavaScript function is then added as a property + of the prototype.

+ + If the method's name begins with "jsStaticFunction_", it is handled + similarly except that the resulting JavaScript function is added as a + property of the constructor object. The Java method must be static. + + If the method's name begins with "jsGet_" or "jsSet_", the method is + considered to define a property. Accesses to the defined property + will result in calls to these getter and setter methods. If no + setter is defined, the property is defined as READONLY.

+ + If the method's name is "jsConstructor", the method is + considered to define the body of the constructor. Only one + method of this name may be defined. + If no method is found that can serve as constructor, a Java + constructor will be selected to serve as the JavaScript + constructor in the following manner. If the class has only one + Java constructor, that constructor is used to define + the JavaScript constructor. If the the class has two constructors, + one must be the zero-argument constructor (otherwise an + EvaluatorException would have already been thrown + when the prototype was to be created). In this case + the Java constructor with one or more parameters will be used + to define the JavaScript constructor. If the class has three + or more constructors, an EvaluatorException + will be thrown.

+ + Finally, if there is a method +

+ static void finishInit(Scriptable scope, FunctionObject constructor,
+                        Scriptable prototype)
+ + it will be called to finish any initialization. The scope + argument will be passed, along with the newly created constructor and + the newly created prototype.

+

+

+
+
+
+
Parameters:
scope - The scope in which to define the constructor.
clazz - The Java class to use to define the JavaScript objects + and properties. +
Throws: +
java.lang.IllegalAccessException - if access is not available + to a reflected class member +
java.lang.InstantiationException - if unable to instantiate + the named class +
java.lang.reflect.InvocationTargetException - if an exception is thrown + during execution of methods of the named class
See Also:
Function, +FunctionObject, +READONLY, +#defineProperty(String, Class, int)
+
+
+
+ +

+defineClass

+
+public static void defineClass(Scriptable scope,
+                               java.lang.Class clazz,
+                               boolean sealed)
+                        throws java.lang.IllegalAccessException,
+                               java.lang.InstantiationException,
+                               java.lang.reflect.InvocationTargetException
+
+
Defines JavaScript objects from a Java class, optionally + allowing sealing. + + Similar to defineClass(Scriptable scope, Class clazz) + except that sealing is allowed. An object that is sealed cannot have + properties added or removed. Note that sealing is not allowed in + the current ECMA/ISO language specification, but is likely for + the next version. +

+

+
+
+
+
Parameters:
scope - The scope in which to define the constructor.
clazz - The Java class to use to define the JavaScript objects + and properties. The class must implement Scriptable.
sealed - Whether or not to create sealed standard objects that + cannot be modified. +
Throws: +
java.lang.IllegalAccessException - if access is not available + to a reflected class member +
java.lang.InstantiationException - if unable to instantiate + the named class +
java.lang.reflect.InvocationTargetException - if an exception is thrown + during execution of methods of the named class
Since:
+
1.4R3
+
+
+
+
+ +

+defineClass

+
+public static java.lang.String defineClass(Scriptable scope,
+                                           java.lang.Class clazz,
+                                           boolean sealed,
+                                           boolean mapInheritance)
+                                    throws java.lang.IllegalAccessException,
+                                           java.lang.InstantiationException,
+                                           java.lang.reflect.InvocationTargetException
+
+
Defines JavaScript objects from a Java class, optionally + allowing sealing and mapping of Java inheritance to JavaScript + prototype-based inheritance. + + Similar to defineClass(Scriptable scope, Class clazz) + except that sealing and inheritance mapping are allowed. An object + that is sealed cannot have properties added or removed. Note that + sealing is not allowed in the current ECMA/ISO language specification, + but is likely for the next version. +

+

+
+
+
+
Parameters:
scope - The scope in which to define the constructor.
clazz - The Java class to use to define the JavaScript objects + and properties. The class must implement Scriptable.
sealed - Whether or not to create sealed standard objects that + cannot be modified.
mapInheritance - Whether or not to map Java inheritance to + JavaScript prototype-based inheritance. +
Returns:
the class name for the prototype of the specified class +
Throws: +
java.lang.IllegalAccessException - if access is not available + to a reflected class member +
java.lang.InstantiationException - if unable to instantiate + the named class +
java.lang.reflect.InvocationTargetException - if an exception is thrown + during execution of methods of the named class
Since:
+
1.6R2
+
+
+
+
+ +

+defineProperty

+
+public void defineProperty(java.lang.String propertyName,
+                           java.lang.Object value,
+                           int attributes)
+
+
Define a JavaScript property. + + Creates the property with an initial value and sets its attributes. +

+

+
+
+
+
Parameters:
propertyName - the name of the property to define.
value - the initial value of the property
attributes - the attributes of the JavaScript property
See Also:
Scriptable.put(String, Scriptable, Object)
+
+
+
+ +

+defineProperty

+
+public static void defineProperty(Scriptable destination,
+                                  java.lang.String propertyName,
+                                  java.lang.Object value,
+                                  int attributes)
+
+
Utility method to add properties to arbitrary Scriptable object. + If destination is instance of ScriptableObject, calls + defineProperty there, otherwise calls put in destination + ignoring attributes +

+

+
+
+
+
+
+
+
+ +

+defineConstProperty

+
+public static void defineConstProperty(Scriptable destination,
+                                       java.lang.String propertyName)
+
+
Utility method to add properties to arbitrary Scriptable object. + If destination is instance of ScriptableObject, calls + defineProperty there, otherwise calls put in destination + ignoring attributes +

+

+
+
+
+
+
+
+
+ +

+defineProperty

+
+public void defineProperty(java.lang.String propertyName,
+                           java.lang.Class clazz,
+                           int attributes)
+
+
Define a JavaScript property with getter and setter side effects. + + If the setter is not found, the attribute READONLY is added to + the given attributes.

+ + The getter must be a method with zero parameters, and the setter, if + found, must be a method with one parameter.

+

+

+
+
+
+
Parameters:
propertyName - the name of the property to define. This name + also affects the name of the setter and getter + to search for. If the propertyId is "foo", then + clazz will be searched for "getFoo" + and "setFoo" methods.
clazz - the Java class to search for the getter and setter
attributes - the attributes of the JavaScript property
See Also:
Scriptable.put(String, Scriptable, Object)
+
+
+
+ +

+defineProperty

+
+public void defineProperty(java.lang.String propertyName,
+                           java.lang.Object delegateTo,
+                           java.lang.reflect.Method getter,
+                           java.lang.reflect.Method setter,
+                           int attributes)
+
+
Define a JavaScript property. + + Use this method only if you wish to define getters and setters for + a given property in a ScriptableObject. To create a property without + special getter or setter side effects, use + defineProperty(String,int). + + If setter is null, the attribute READONLY is added to + the given attributes.

+ + Several forms of getters or setters are allowed. In all cases the + type of the value parameter can be any one of the following types: + Object, String, boolean, Scriptable, byte, short, int, long, float, + or double. The runtime will perform appropriate conversions based + upon the type of the parameter (see description in FunctionObject). + The first forms are nonstatic methods of the class referred to + by 'this': +

+ Object getFoo();
+ void setFoo(SomeType value);
+ Next are static methods that may be of any class; the object whose + property is being accessed is passed in as an extra argument: +
+ static Object getFoo(Scriptable obj);
+ static void setFoo(Scriptable obj, SomeType value);
+ Finally, it is possible to delegate to another object entirely using + the delegateTo parameter. In this case the methods are + nonstatic methods of the class delegated to, and the object whose + property is being accessed is passed in as an extra argument: +
+ Object getFoo(Scriptable obj);
+ void setFoo(Scriptable obj, SomeType value);
+

+

+
+
+
+
Parameters:
propertyName - the name of the property to define.
delegateTo - an object to call the getter and setter methods on, + or null, depending on the form used above.
getter - the method to invoke to get the value of the property
setter - the method to invoke to set the value of the property
attributes - the attributes of the JavaScript property
+
+
+
+ +

+defineFunctionProperties

+
+public void defineFunctionProperties(java.lang.String[] names,
+                                     java.lang.Class clazz,
+                                     int attributes)
+
+
Search for names in a class, adding the resulting methods + as properties. + +

Uses reflection to find the methods of the given names. Then + FunctionObjects are constructed from the methods found, and + are added to this object as properties with the given names. +

+

+
+
+
+
Parameters:
names - the names of the Methods to add as function properties
clazz - the class to search for the Methods
attributes - the attributes of the new properties
See Also:
FunctionObject
+
+
+
+ +

+getObjectPrototype

+
+public static Scriptable getObjectPrototype(Scriptable scope)
+
+
Get the Object.prototype property. + See ECMA 15.2.4. +

+

+
+
+
+
+
+
+
+ +

+getFunctionPrototype

+
+public static Scriptable getFunctionPrototype(Scriptable scope)
+
+
Get the Function.prototype property. + See ECMA 15.3.4. +

+

+
+
+
+
+
+
+
+ +

+getClassPrototype

+
+public static Scriptable getClassPrototype(Scriptable scope,
+                                           java.lang.String className)
+
+
Get the prototype for the named class. + + For example, getClassPrototype(s, "Date") will first + walk up the parent chain to find the outermost scope, then will + search that scope for the Date constructor, and then will + return Date.prototype. If any of the lookups fail, or + the prototype is not a JavaScript object, then null will + be returned. +

+

+
+
+
+
Parameters:
scope - an object in the scope chain
className - the name of the constructor +
Returns:
the prototype for the named class, or null if it + cannot be found.
+
+
+
+ +

+getTopLevelScope

+
+public static Scriptable getTopLevelScope(Scriptable obj)
+
+
Get the global scope. + +

Walks the parent scope chain to find an object with a null + parent scope (the global object). +

+

+
+
+
+
Parameters:
obj - a JavaScript object +
Returns:
the corresponding global scope
+
+
+
+ +

+sealObject

+
+public void sealObject()
+
+
Seal this object. + + A sealed object may not have properties added or removed. Once + an object is sealed it may not be unsealed. +

+

+
+
+
+
Since:
+
1.4R3
+
+
+
+
+ +

+isSealed

+
+public final boolean isSealed()
+
+
Return true if this object is sealed. + + It is an error to attempt to add or remove properties to + a sealed object. +

+

+
+
+
+ +
Returns:
true if sealed, false otherwise.
Since:
+
1.4R3
+
+
+
+
+ +

+getProperty

+
+public static java.lang.Object getProperty(Scriptable obj,
+                                           java.lang.String name)
+
+
Gets a named property from an object or any object in its prototype chain. +

+ Searches the prototype chain for a property named name. +

+

+

+
+
+
+
Parameters:
obj - a JavaScript object
name - a property name +
Returns:
the value of a property with name name found in + obj or any object in its prototype chain, or + Scriptable.NOT_FOUND if not found
Since:
+
1.5R2
+
+
+
+
+ +

+getProperty

+
+public static java.lang.Object getProperty(Scriptable obj,
+                                           int index)
+
+
Gets an indexed property from an object or any object in its prototype chain. +

+ Searches the prototype chain for a property with integral index + index. Note that if you wish to look for properties with numerical + but non-integral indicies, you should use getProperty(Scriptable,String) with + the string value of the index. +

+

+

+
+
+
+
Parameters:
obj - a JavaScript object
index - an integral index +
Returns:
the value of a property with index index found in + obj or any object in its prototype chain, or + Scriptable.NOT_FOUND if not found
Since:
+
1.5R2
+
+
+
+
+ +

+hasProperty

+
+public static boolean hasProperty(Scriptable obj,
+                                  java.lang.String name)
+
+
Returns whether a named property is defined in an object or any object + in its prototype chain. +

+ Searches the prototype chain for a property named name. +

+

+

+
+
+
+
Parameters:
obj - a JavaScript object
name - a property name +
Returns:
the true if property was found
Since:
+
1.5R2
+
+
+
+
+ +

+redefineProperty

+
+public static void redefineProperty(Scriptable obj,
+                                    java.lang.String name,
+                                    boolean isConst)
+
+
If hasProperty(obj, name) would return true, then if the property that + was found is compatible with the new property, this method just returns. + If the property is not compatible, then an exception is thrown. + + A property redefinition is incompatible if the first definition was a + const declaration or if this one is. They are compatible only if neither + was const. +

+

+
+
+
+
+
+
+
+ +

+hasProperty

+
+public static boolean hasProperty(Scriptable obj,
+                                  int index)
+
+
Returns whether an indexed property is defined in an object or any object + in its prototype chain. +

+ Searches the prototype chain for a property with index index. +

+

+

+
+
+
+
Parameters:
obj - a JavaScript object
index - a property index +
Returns:
the true if property was found
Since:
+
1.5R2
+
+
+
+
+ +

+putProperty

+
+public static void putProperty(Scriptable obj,
+                               java.lang.String name,
+                               java.lang.Object value)
+
+
Puts a named property in an object or in an object in its prototype chain. +

+ Searches for the named property in the prototype chain. If it is found, + the value of the property in obj is changed through a call + to Scriptable.put(String, Scriptable, Object) on the + prototype passing obj as the start argument. + This allows the prototype to veto the property setting in case the + prototype defines the property with [[ReadOnly]] attribute. If the + property is not found, it is added in obj. +

+

+
+
+
+
Parameters:
obj - a JavaScript object
name - a property name
value - any JavaScript value accepted by Scriptable.put
Since:
+
1.5R2
+
+
+
+
+ +

+putConstProperty

+
+public static void putConstProperty(Scriptable obj,
+                                    java.lang.String name,
+                                    java.lang.Object value)
+
+
Puts a named property in an object or in an object in its prototype chain. +

+ Searches for the named property in the prototype chain. If it is found, + the value of the property in obj is changed through a call + to Scriptable.put(String, Scriptable, Object) on the + prototype passing obj as the start argument. + This allows the prototype to veto the property setting in case the + prototype defines the property with [[ReadOnly]] attribute. If the + property is not found, it is added in obj. +

+

+
+
+
+
Parameters:
obj - a JavaScript object
name - a property name
value - any JavaScript value accepted by Scriptable.put
Since:
+
1.5R2
+
+
+
+
+ +

+putProperty

+
+public static void putProperty(Scriptable obj,
+                               int index,
+                               java.lang.Object value)
+
+
Puts an indexed property in an object or in an object in its prototype chain. +

+ Searches for the indexed property in the prototype chain. If it is found, + the value of the property in obj is changed through a call + to Scriptable.put(int, Scriptable, Object) on the prototype + passing obj as the start argument. This allows + the prototype to veto the property setting in case the prototype defines + the property with [[ReadOnly]] attribute. If the property is not found, + it is added in obj. +

+

+
+
+
+
Parameters:
obj - a JavaScript object
index - a property index
value - any JavaScript value accepted by Scriptable.put
Since:
+
1.5R2
+
+
+
+
+ +

+deleteProperty

+
+public static boolean deleteProperty(Scriptable obj,
+                                     java.lang.String name)
+
+
Removes the property from an object or its prototype chain. +

+ Searches for a property with name in obj or + its prototype chain. If it is found, the object's delete + method is called. +

+

+
+
+
+
Parameters:
obj - a JavaScript object
name - a property name +
Returns:
true if the property doesn't exist or was successfully removed
Since:
+
1.5R2
+
+
+
+
+ +

+deleteProperty

+
+public static boolean deleteProperty(Scriptable obj,
+                                     int index)
+
+
Removes the property from an object or its prototype chain. +

+ Searches for a property with index in obj or + its prototype chain. If it is found, the object's delete + method is called. +

+

+
+
+
+
Parameters:
obj - a JavaScript object
index - a property index +
Returns:
true if the property doesn't exist or was successfully removed
Since:
+
1.5R2
+
+
+
+
+ +

+getPropertyIds

+
+public static java.lang.Object[] getPropertyIds(Scriptable obj)
+
+
Returns an array of all ids from an object and its prototypes. +

+

+

+
+
+
+
Parameters:
obj - a JavaScript object +
Returns:
an array of all ids from all object in the prototype chain. + If a given id occurs multiple times in the prototype chain, + it will occur only once in this list.
Since:
+
1.5R2
+
+
+
+
+ +

+callMethod

+
+public static java.lang.Object callMethod(Scriptable obj,
+                                          java.lang.String methodName,
+                                          java.lang.Object[] args)
+
+
Call a method of an object. +

+

+
+
+
+
Parameters:
obj - the JavaScript object
methodName - the name of the function property
args - the arguments for the call
See Also:
Context.getCurrentContext()
+
+
+
+ +

+callMethod

+
+public static java.lang.Object callMethod(Context cx,
+                                          Scriptable obj,
+                                          java.lang.String methodName,
+                                          java.lang.Object[] args)
+
+
Call a method of an object. +

+

+
+
+
+
Parameters:
cx - the Context object associated with the current thread.
obj - the JavaScript object
methodName - the name of the function property
args - the arguments for the call
+
+
+
+ +

+getAssociatedValue

+
+public final java.lang.Object getAssociatedValue(java.lang.Object key)
+
+
Get arbitrary application-specific value associated with this object. +

+

+
+
+
+
Parameters:
key - key object to select particular value.
See Also:
associateValue(Object key, Object value)
+
+
+
+ +

+getTopScopeValue

+
+public static java.lang.Object getTopScopeValue(Scriptable scope,
+                                                java.lang.Object key)
+
+
Get arbitrary application-specific value associated with the top scope + of the given scope. + The method first calls getTopLevelScope(Scriptable scope) + and then searches the prototype chain of the top scope for the first + object containing the associated value with the given key. +

+

+
+
+
+
Parameters:
scope - the starting scope.
key - key object to select particular value.
See Also:
getAssociatedValue(Object key)
+
+
+
+ +

+associateValue

+
+public final java.lang.Object associateValue(java.lang.Object key,
+                                             java.lang.Object value)
+
+
Associate arbitrary application-specific value with this object. + Value can only be associated with the given object and key only once. + The method ignores any subsequent attempts to change the already + associated value. +

The associated values are not serialized. +

+

+
+
+
+
Parameters:
key - key object to select particular value.
value - the value to associate +
Returns:
the passed value if the method is called first time for the + given key or old value for any subsequent calls.
See Also:
getAssociatedValue(Object key)
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html new file mode 100644 index 0000000..92c5c44 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/SecurityController.html @@ -0,0 +1,507 @@ + + + + + + +SecurityController (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class SecurityController

+
+java.lang.Object
+  extended by org.mozilla.javascript.SecurityController
+
+
+
+
public abstract class SecurityController
extends java.lang.Object
+ + +

+This class describes the support needed to implement security. +

+ Three main pieces of functionality are required to implement + security for JavaScript. First, it must be possible to define + classes with an associated security domain. (This security + domain may be any object incorporating notion of access + restrictions that has meaning to an embedding; for a client-side + JavaScript embedding this would typically be + java.security.ProtectionDomain or similar object depending on an + origin URL and/or a digital certificate.) + Next it must be possible to get a security domain object that + allows a particular action only if all security domains + associated with code on the current Java stack allows it. And + finally, it must be possible to execute script code with + associated security domain injected into Java stack. +

+ These three pieces of functionality are encapsulated in the + SecurityController class. +

+ +

+

+
Since:
+
1.5 Release 4
+
See Also:
Context.setSecurityController(SecurityController), +ClassLoader
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
SecurityController() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ObjectcallWithDomain(java.lang.Object securityDomain, + Context cx, + Callable callable, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Call Callable.call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + of callable under restricted security domain where an action is + allowed only if it is allowed according to the Java stack on the + moment of the execWithDomain call and securityDomain.
+abstract  GeneratedClassLoadercreateClassLoader(java.lang.ClassLoader parentLoader, + java.lang.Object securityDomain) + +
+          Get class loader-like object that can be used + to define classes with the given security context.
+static GeneratedClassLoadercreateLoader(java.lang.ClassLoader parent, + java.lang.Object staticDomain) + +
+          Create GeneratedClassLoader with restrictions imposed by + staticDomain and all current stack frames.
+ java.lang.ObjectexecWithDomain(Context cx, + Scriptable scope, + Script script, + java.lang.Object securityDomain) + +
+          Deprecated. The application should not override this method and instead + override + callWithDomain(Object securityDomain, Context cx, Callable callable, Scriptable scope, Scriptable thisObj, Object[] args).
+abstract  java.lang.ObjectgetDynamicSecurityDomain(java.lang.Object securityDomain) + +
+          Get dynamic security domain that allows an action only if it is allowed + by the current Java stack and securityDomain.
+static java.lang.ClassgetStaticSecurityDomainClass() + +
+           
+ java.lang.ClassgetStaticSecurityDomainClassInternal() + +
+           
+static booleanhasGlobal() + +
+          Check if global SecurityController was already installed.
+static voidinitGlobal(SecurityController controller) + +
+          Initialize global controller that will be used for all + security-related operations.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+SecurityController

+
+public SecurityController()
+
+
+ + + + + + + + +
+Method Detail
+ +

+hasGlobal

+
+public static boolean hasGlobal()
+
+
Check if global SecurityController was already installed. +

+

+
See Also:
initGlobal(SecurityController controller)
+
+
+
+ +

+initGlobal

+
+public static void initGlobal(SecurityController controller)
+
+
Initialize global controller that will be used for all + security-related operations. The global controller takes precedence + over already installed Context-specific controllers and cause + any subsequent call to + Context.setSecurityController(SecurityController) + to throw an exception. +

+ The method can only be called once. +

+

+
See Also:
hasGlobal()
+
+
+
+ +

+createClassLoader

+
+public abstract GeneratedClassLoader createClassLoader(java.lang.ClassLoader parentLoader,
+                                                       java.lang.Object securityDomain)
+
+
Get class loader-like object that can be used + to define classes with the given security context. +

+

+
Parameters:
parentLoader - parent class loader to delegate search for classes + not defined by the class loader itself
securityDomain - some object specifying the security + context of the code that is defined by the returned class loader.
+
+
+
+ +

+createLoader

+
+public static GeneratedClassLoader createLoader(java.lang.ClassLoader parent,
+                                                java.lang.Object staticDomain)
+
+
Create GeneratedClassLoader with restrictions imposed by + staticDomain and all current stack frames. + The method uses the SecurityController instance associated with the + current Context to construct proper dynamic domain and create + corresponding class loader. + + If no SecurityController is associated with the current Context , + the method calls Context.createClassLoader(ClassLoader parent). +

+

+
Parameters:
parent - parent class loader. If null, + Context.getApplicationClassLoader() will be used.
staticDomain - static security domain.
+
+
+
+ +

+getStaticSecurityDomainClass

+
+public static java.lang.Class getStaticSecurityDomainClass()
+
+
+
+
+
+
+ +

+getStaticSecurityDomainClassInternal

+
+public java.lang.Class getStaticSecurityDomainClassInternal()
+
+
+
+
+
+
+ +

+getDynamicSecurityDomain

+
+public abstract java.lang.Object getDynamicSecurityDomain(java.lang.Object securityDomain)
+
+
Get dynamic security domain that allows an action only if it is allowed + by the current Java stack and securityDomain. If + securityDomain is null, return domain representing permissions + allowed by the current stack. +

+

+
+
+
+
+ +

+callWithDomain

+
+public java.lang.Object callWithDomain(java.lang.Object securityDomain,
+                                       Context cx,
+                                       Callable callable,
+                                       Scriptable scope,
+                                       Scriptable thisObj,
+                                       java.lang.Object[] args)
+
+
Call Callable.call(Context cx, Scriptable scope, Scriptable thisObj, + Object[] args) + of callable under restricted security domain where an action is + allowed only if it is allowed according to the Java stack on the + moment of the execWithDomain call and securityDomain. + Any call to getDynamicSecurityDomain(Object) during + execution of callable.call(cx, scope, thisObj, args) + should return a domain incorporate restrictions imposed by + securityDomain and Java stack on the moment of callWithDomain + invocation. +

+ The method should always be overridden, it is not declared abstract + for compatibility reasons. +

+

+
+
+
+
+ +

+execWithDomain

+
+public java.lang.Object execWithDomain(Context cx,
+                                       Scriptable scope,
+                                       Script script,
+                                       java.lang.Object securityDomain)
+
+
Deprecated. The application should not override this method and instead + override + callWithDomain(Object securityDomain, Context cx, Callable callable, Scriptable scope, Scriptable thisObj, Object[] args). +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html new file mode 100644 index 0000000..05b8fb4 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Synchronizer.html @@ -0,0 +1,331 @@ + + + + + + +Synchronizer (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class Synchronizer

+
+java.lang.Object
+  extended by org.mozilla.javascript.Delegator
+      extended by org.mozilla.javascript.Synchronizer
+
+
+
All Implemented Interfaces:
Callable, Function, Scriptable
+
+
+
+
public class Synchronizer
extends org.mozilla.javascript.Delegator
+ + +

+This class provides support for implementing Java-style synchronized + methods in Javascript. + + Synchronized functions are created from ordinary Javascript + functions by the Synchronizer constructor, e.g. + new Packages.org.mozilla.javascript.Synchronizer(fun). + The resulting object is a function that establishes an exclusive + lock on the this object of its invocation. + + The Rhino shell provides a short-cut for the creation of + synchronized methods: sync(fun) has the same effect as + calling the above constructor. +

+ +

+

+
Author:
+
Matthias Radestock
+
See Also:
Delegator
+
+ +

+ + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from class org.mozilla.javascript.Delegator
obj
+ + + + + + + +
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
+  + + + + + + + + + + +
+Constructor Summary
Synchronizer(Scriptable obj) + +
+          Create a new synchronized function from an existing one.
+  + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectcall(Context cx, + Scriptable scope, + Scriptable thisObj, + java.lang.Object[] args) + +
+          Call the function.
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.Delegator
construct, delete, delete, get, get, getClassName, getDefaultValue, getDelegee, getIds, getParentScope, getPrototype, has, has, hasInstance, newInstance, put, put, setDelegee, setParentScope, setPrototype
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+Synchronizer

+
+public Synchronizer(Scriptable obj)
+
+
Create a new synchronized function from an existing one. +

+

+
Parameters:
obj - the existing function
+
+ + + + + + + + +
+Method Detail
+ +

+call

+
+public java.lang.Object call(Context cx,
+                             Scriptable scope,
+                             Scriptable thisObj,
+                             java.lang.Object[] args)
+
+
Description copied from interface: Function
+
Call the function. + + Note that the array of arguments is not guaranteed to have + length greater than 0. +

+

+
Specified by:
call in interface Callable
Specified by:
call in interface Function
Overrides:
call in class org.mozilla.javascript.Delegator
+
+
+
Parameters:
cx - the current Context for this thread
scope - the scope to execute the function relative to. This is + set to the value returned by getParentScope() except + when the function is called from a closure.
thisObj - the JavaScript this object
args - the array of arguments +
Returns:
the result of the call
See Also:
Function.call(org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html new file mode 100644 index 0000000..675c456 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrapFactory.html @@ -0,0 +1,400 @@ + + + + + + +WrapFactory (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class WrapFactory

+
+java.lang.Object
+  extended by org.mozilla.javascript.WrapFactory
+
+
+
+
public class WrapFactory
extends java.lang.Object
+ + +

+Embeddings that wish to provide their own custom wrappings for Java + objects may extend this class and call + Context.setWrapFactory(WrapFactory) + Once an instance of this class or an extension of this class is enabled + for a given context (by calling setWrapFactory on that context), Rhino + will call the methods of this class whenever it needs to wrap a value + resulting from a call to a Java method or an access to a Java field. +

+ +

+

+
Since:
+
1.5 Release 4
+
See Also:
Context.setWrapFactory(WrapFactory)
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
WrapFactory() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ booleanisJavaPrimitiveWrap() + +
+          Return false if result of Java method, which is instance of + String, Number, Boolean and + Character, should be used directly as JavaScript primitive + type.
+ voidsetJavaPrimitiveWrap(boolean value) + +
+           
+ java.lang.Objectwrap(Context cx, + Scriptable scope, + java.lang.Object obj, + java.lang.Class staticType) + +
+          Wrap the object.
+ ScriptablewrapAsJavaObject(Context cx, + Scriptable scope, + java.lang.Object javaObject, + java.lang.Class staticType) + +
+          Wrap Java object as Scriptable instance to allow full access to its + methods and fields from JavaScript.
+ ScriptablewrapNewObject(Context cx, + Scriptable scope, + java.lang.Object obj) + +
+          Wrap an object newly created by a constructor call.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+WrapFactory

+
+public WrapFactory()
+
+
+ + + + + + + + +
+Method Detail
+ +

+wrap

+
+public java.lang.Object wrap(Context cx,
+                             Scriptable scope,
+                             java.lang.Object obj,
+                             java.lang.Class staticType)
+
+
Wrap the object. +

+ The value returned must be one of +

    +
  • java.lang.Boolean
  • +
  • java.lang.String
  • +
  • java.lang.Number
  • +
  • org.mozilla.javascript.Scriptable objects
  • +
  • The value returned by Context.getUndefinedValue()
  • +
  • null
  • +
+

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
obj - the object to be wrapped. Note it can be null.
staticType - type hint. If security restrictions prevent to wrap + object based on its class, staticType will be used instead. +
Returns:
the wrapped value.
+
+
+
+ +

+wrapNewObject

+
+public Scriptable wrapNewObject(Context cx,
+                                Scriptable scope,
+                                java.lang.Object obj)
+
+
Wrap an object newly created by a constructor call. +

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
obj - the object to be wrapped +
Returns:
the wrapped value.
+
+
+
+ +

+wrapAsJavaObject

+
+public Scriptable wrapAsJavaObject(Context cx,
+                                   Scriptable scope,
+                                   java.lang.Object javaObject,
+                                   java.lang.Class staticType)
+
+
Wrap Java object as Scriptable instance to allow full access to its + methods and fields from JavaScript. +

+ wrap(Context, Scriptable, Object, Class) and + wrapNewObject(Context, Scriptable, Object) call this method + when they can not convert javaObject to JavaScript primitive + value or JavaScript array. +

+ Subclasses can override the method to provide custom wrappers + for Java objects. +

+

+
Parameters:
cx - the current Context for this thread
scope - the scope of the executing script
javaObject - the object to be wrapped
staticType - type hint. If security restrictions prevent to wrap + object based on its class, staticType will be used instead. +
Returns:
the wrapped value which shall not be null
+
+
+
+ +

+isJavaPrimitiveWrap

+
+public final boolean isJavaPrimitiveWrap()
+
+
Return false if result of Java method, which is instance of + String, Number, Boolean and + Character, should be used directly as JavaScript primitive + type. + By default the method returns true to indicate that instances of + String, Number, Boolean and + Character should be wrapped as any other Java object and + scripts can access any Java method available in these objects. + Use setJavaPrimitiveWrap(boolean) to change this. +

+

+
+
+
+
+ +

+setJavaPrimitiveWrap

+
+public final void setJavaPrimitiveWrap(boolean value)
+
+
+
See Also:
isJavaPrimitiveWrap()
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html new file mode 100644 index 0000000..1109997 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/WrappedException.html @@ -0,0 +1,323 @@ + + + + + + +WrappedException (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Class WrappedException

+
+java.lang.Object
+  extended by java.lang.Throwable
+      extended by java.lang.Exception
+          extended by java.lang.RuntimeException
+              extended by org.mozilla.javascript.RhinoException
+                  extended by org.mozilla.javascript.EvaluatorException
+                      extended by org.mozilla.javascript.WrappedException
+
+
+
All Implemented Interfaces:
java.io.Serializable
+
+
+
+
public class WrappedException
extends EvaluatorException
+ + +

+A wrapper for runtime exceptions. + + Used by the JavaScript runtime to wrap and propagate exceptions that occur + during runtime. +

+ +

+

+
Author:
+
Norris Boyd
+
See Also:
Serialized Form
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
WrappedException(java.lang.Throwable exception) + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.ThrowablegetWrappedException() + +
+          Get the wrapped exception.
+ java.lang.Objectunwrap() + +
+          Deprecated. Use getWrappedException() instead.
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.EvaluatorException
getColumnNumber, getLineNumber, getLineSource, getSourceName
+ + + + + + + +
Methods inherited from class org.mozilla.javascript.RhinoException
columnNumber, details, getMessage, getScriptStackTrace, getScriptStackTrace, initColumnNumber, initLineNumber, initLineSource, initSourceName, lineNumber, lineSource, printStackTrace, printStackTrace, sourceName
+ + + + + + + +
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+WrappedException

+
+public WrappedException(java.lang.Throwable exception)
+
+
+
See Also:
Context.throwAsScriptRuntimeEx(Throwable e)
+
+ + + + + + + + +
+Method Detail
+ +

+getWrappedException

+
+public java.lang.Throwable getWrappedException()
+
+
Get the wrapped exception. +

+

+ +
Returns:
the exception that was presented as a argument to the + constructor when this object was created
+
+
+
+ +

+unwrap

+
+public java.lang.Object unwrap()
+
+
Deprecated. Use getWrappedException() instead. +

+

+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html new file mode 100644 index 0000000..0d05fdc --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/Wrapper.html @@ -0,0 +1,214 @@ + + + + + + +Wrapper (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript +
+Interface Wrapper

+
+
+
public interface Wrapper
+ + +

+Objects that can wrap other values for reflection in the JS environment + will implement Wrapper. + + Wrapper defines a single method that can be called to unwrap the object. +

+ +

+


+ +

+ + + + + + + + + + + + +
+Method Summary
+ java.lang.Objectunwrap() + +
+          Unwrap the object by returning the wrapped value.
+  +

+ + + + + + + + +
+Method Detail
+ +

+unwrap

+
+java.lang.Object unwrap()
+
+
Unwrap the object by returning the wrapped value. +

+

+ +
Returns:
a wrapped value
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html new file mode 100644 index 0000000..1159738 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/DebuggableScript.html @@ -0,0 +1,455 @@ + + + + + + +DebuggableScript (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript.debug +
+Interface DebuggableScript

+
+
+
public interface DebuggableScript
+ + +

+This interface exposes debugging information from executable + code (either functions or top-level scripts). +

+ +

+


+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ DebuggableScriptgetFunction(int index) + +
+           
+ intgetFunctionCount() + +
+           
+ java.lang.StringgetFunctionName() + +
+          Get name of the function described by this script.
+ int[]getLineNumbers() + +
+          Get array containing the line numbers that + that can be passed to DebugFrame.onLineChange().
+ intgetParamAndVarCount() + +
+          Get number of declared parameters and local variables.
+ intgetParamCount() + +
+          Get number of declared parameters in the function.
+ java.lang.StringgetParamOrVarName(int index) + +
+          Get name of a declared parameter or local variable.
+ DebuggableScriptgetParent() + +
+           
+ java.lang.StringgetSourceName() + +
+          Get the name of the source (usually filename or URL) + of the script.
+ booleanisFunction() + +
+          Returns true if this is a function, false if it is a script.
+ booleanisGeneratedScript() + +
+          Returns true if this script or function were runtime-generated + from JavaScript using eval function or Function + or Script constructors.
+ booleanisTopLevel() + +
+           
+  +

+ + + + + + + + +
+Method Detail
+ +

+isTopLevel

+
+boolean isTopLevel()
+
+
+
+
+
+
+ +

+isFunction

+
+boolean isFunction()
+
+
Returns true if this is a function, false if it is a script. +

+

+
+
+
+
+ +

+getFunctionName

+
+java.lang.String getFunctionName()
+
+
Get name of the function described by this script. + Return null or an empty string if this script is not a function. +

+

+
+
+
+
+ +

+getParamCount

+
+int getParamCount()
+
+
Get number of declared parameters in the function. + Return 0 if this script is not a function. +

+

+
See Also:
getParamAndVarCount(), +getParamOrVarName(int index)
+
+
+
+ +

+getParamAndVarCount

+
+int getParamAndVarCount()
+
+
Get number of declared parameters and local variables. + Return number of declared global variables if this script is not a + function. +

+

+
See Also:
getParamCount(), +getParamOrVarName(int index)
+
+
+
+ +

+getParamOrVarName

+
+java.lang.String getParamOrVarName(int index)
+
+
Get name of a declared parameter or local variable. + index should be less then getParamAndVarCount(). + If index < getParamCount(), return + the name of the corresponding parameter, otherwise return the name + of variable. + If this script is not function, return the name of the declared + global variable. +

+

+
+
+
+
+ +

+getSourceName

+
+java.lang.String getSourceName()
+
+
Get the name of the source (usually filename or URL) + of the script. +

+

+
+
+
+
+ +

+isGeneratedScript

+
+boolean isGeneratedScript()
+
+
Returns true if this script or function were runtime-generated + from JavaScript using eval function or Function + or Script constructors. +

+

+
+
+
+
+ +

+getLineNumbers

+
+int[] getLineNumbers()
+
+
Get array containing the line numbers that + that can be passed to DebugFrame.onLineChange(). + Note that line order in the resulting array is arbitrary +

+

+
+
+
+
+ +

+getFunctionCount

+
+int getFunctionCount()
+
+
+
+
+
+
+ +

+getFunction

+
+DebuggableScript getFunction(int index)
+
+
+
+
+
+
+ +

+getParent

+
+DebuggableScript getParent()
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html new file mode 100644 index 0000000..28878a0 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +org.mozilla.javascript.debug (Rhino) + + + + + + + + + + + +org.mozilla.javascript.debug + + + + +
+Interfaces  + +
+DebuggableScript
+ + + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html new file mode 100644 index 0000000..1a50d7f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-summary.html @@ -0,0 +1,156 @@ + + + + + + +org.mozilla.javascript.debug (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.mozilla.javascript.debug +

+ + + + + + + + + +
+Interface Summary
DebuggableScriptThis interface exposes debugging information from executable + code (either functions or top-level scripts).
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html new file mode 100644 index 0000000..d32bdf5 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/debug/package-tree.html @@ -0,0 +1,149 @@ + + + + + + +org.mozilla.javascript.debug Class Hierarchy (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.mozilla.javascript.debug +

+
+
+
Package Hierarchies:
All Packages
+
+

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html new file mode 100644 index 0000000..bdce431 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/ClassCompiler.html @@ -0,0 +1,461 @@ + + + + + + +ClassCompiler (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript.optimizer +
+Class ClassCompiler

+
+java.lang.Object
+  extended by org.mozilla.javascript.optimizer.ClassCompiler
+
+
+
+
public class ClassCompiler
extends java.lang.Object
+ + +

+Generates class files from script sources. + + since 1.5 Release 5 +

+ +

+

+
Author:
+
Igor Bukanov
+
+
+ +

+ + + + + + + + + + + +
+Constructor Summary
ClassCompiler(CompilerEnvirons compilerEnv) + +
+          Construct ClassCompiler that uses the specified compiler environment + when generating classes.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ java.lang.Object[]compileToClassFiles(java.lang.String source, + java.lang.String sourceLocation, + int lineno, + java.lang.String mainClassName) + +
+          Compile JavaScript source into one or more Java class files.
+ CompilerEnvironsgetCompilerEnv() + +
+          Get the compiler environment the compiler uses.
+ java.lang.StringgetMainMethodClass() + +
+          Get the name of the class for main method implementation.
+ java.lang.ClassgetTargetExtends() + +
+          Get the class that the generated target will extend.
+ java.lang.Class[]getTargetImplements() + +
+          Get the interfaces that the generated target will implement.
+protected  java.lang.StringmakeAuxiliaryClassName(java.lang.String mainClassName, + java.lang.String auxMarker) + +
+          Build class name for a auxiliary class generated by compiler.
+ voidsetMainMethodClass(java.lang.String className) + +
+          Set the class name to use for main method implementation.
+ voidsetTargetExtends(java.lang.Class extendsClass) + +
+          Set the class that the generated target will extend.
+ voidsetTargetImplements(java.lang.Class[] implementsClasses) + +
+          Set the interfaces that the generated target will implement.
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ClassCompiler

+
+public ClassCompiler(CompilerEnvirons compilerEnv)
+
+
Construct ClassCompiler that uses the specified compiler environment + when generating classes. +

+

+ + + + + + + + +
+Method Detail
+ +

+setMainMethodClass

+
+public void setMainMethodClass(java.lang.String className)
+
+
Set the class name to use for main method implementation. + The class must have a method matching + public static void main(Script sc, String[] args), it will be + called when main(String[] args) is called in the generated + class. The class name should be fully qulified name and include the + package name like in org.foo.Bar. +

+

+
+
+
+
+ +

+getMainMethodClass

+
+public java.lang.String getMainMethodClass()
+
+
Get the name of the class for main method implementation. +

+

+
See Also:
setMainMethodClass(String)
+
+
+
+ +

+getCompilerEnv

+
+public CompilerEnvirons getCompilerEnv()
+
+
Get the compiler environment the compiler uses. +

+

+
+
+
+
+ +

+getTargetExtends

+
+public java.lang.Class getTargetExtends()
+
+
Get the class that the generated target will extend. +

+

+
+
+
+
+ +

+setTargetExtends

+
+public void setTargetExtends(java.lang.Class extendsClass)
+
+
Set the class that the generated target will extend. +

+

+
Parameters:
extendsClass - the class it extends
+
+
+
+ +

+getTargetImplements

+
+public java.lang.Class[] getTargetImplements()
+
+
Get the interfaces that the generated target will implement. +

+

+
+
+
+
+ +

+setTargetImplements

+
+public void setTargetImplements(java.lang.Class[] implementsClasses)
+
+
Set the interfaces that the generated target will implement. +

+

+
Parameters:
implementsClasses - an array of Class objects, one for each + interface the target will extend
+
+
+
+ +

+makeAuxiliaryClassName

+
+protected java.lang.String makeAuxiliaryClassName(java.lang.String mainClassName,
+                                                  java.lang.String auxMarker)
+
+
Build class name for a auxiliary class generated by compiler. + If the compiler needs to generate extra classes beyond the main class, + it will call this function to build the auxiliary class name. + The default implementation simply appends auxMarker to mainClassName + but this can be overridden. +

+

+
+
+
+
+ +

+compileToClassFiles

+
+public java.lang.Object[] compileToClassFiles(java.lang.String source,
+                                              java.lang.String sourceLocation,
+                                              int lineno,
+                                              java.lang.String mainClassName)
+
+
Compile JavaScript source into one or more Java class files. + The first compiled class will have name mainClassName. + If the results of getTargetExtends() or + getTargetImplements() are not null, then the first compiled + class will extend the specified super class and implement + specified interfaces. +

+

+ +
Returns:
array where elements with even indexes specifies class name + and the following odd index gives class file body as byte[] + array. The initial element of the array always holds + mainClassName and array[1] holds its byte code.
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html new file mode 100644 index 0000000..1dc284b --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-frame.html @@ -0,0 +1,32 @@ + + + + + + +org.mozilla.javascript.optimizer (Rhino) + + + + + + + + + + + +org.mozilla.javascript.optimizer + + + + +
+Classes  + +
+ClassCompiler
+ + + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html new file mode 100644 index 0000000..8b86a40 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-summary.html @@ -0,0 +1,155 @@ + + + + + + +org.mozilla.javascript.optimizer (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.mozilla.javascript.optimizer +

+ + + + + + + + + +
+Class Summary
ClassCompilerGenerates class files from script sources.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html new file mode 100644 index 0000000..55e23d0 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/optimizer/package-tree.html @@ -0,0 +1,151 @@ + + + + + + +org.mozilla.javascript.optimizer Class Hierarchy (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.mozilla.javascript.optimizer +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • java.lang.Object +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html new file mode 100644 index 0000000..f40351c --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-frame.html @@ -0,0 +1,100 @@ + + + + + + +org.mozilla.javascript (Rhino) + + + + + + + + + + + +org.mozilla.javascript + + + + +
+Interfaces  + +
+Callable +
+ClassShutter +
+ContextAction +
+ContextFactory.Listener +
+ErrorReporter +
+Function +
+GeneratedClassLoader +
+RefCallable +
+Script +
+Scriptable +
+Wrapper
+ + + + + + +
+Classes  + +
+ClassCache +
+CompilerEnvirons +
+Context +
+ContextFactory +
+FunctionObject +
+ImporterTopLevel +
+ScriptableObject +
+SecurityController +
+Synchronizer +
+WrapFactory
+ + + + + + +
+Exceptions  + +
+EcmaError +
+EvaluatorException +
+JavaScriptException +
+RhinoException +
+WrappedException
+ + + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html new file mode 100644 index 0000000..c15d3c1 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-summary.html @@ -0,0 +1,294 @@ + + + + + + +org.mozilla.javascript (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.mozilla.javascript +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Interface Summary
CallableGeneric notion of callable object that can execute some script-related code + upon request with specified values for script scope and this objects.
ClassShutterEmbeddings that wish to filter Java classes that are visible to scripts +through the LiveConnect, should implement this interface.
ContextActionInterface to represent arbitrary action that requires to have Context + object associated with the current thread for its execution.
ContextFactory.ListenerListener of Context creation and release events.
ErrorReporterThis is interface defines a protocol for the reporting of + errors during JavaScript translation or execution.
FunctionThis is interface that all functions in JavaScript must implement.
GeneratedClassLoaderInterface to define classes from generated byte code.
RefCallableObject that can allows assignments to the result of function calls.
ScriptAll compiled scripts implement this interface.
ScriptableThis is interface that all objects in JavaScript must implement.
WrapperObjects that can wrap other values for reflection in the JS environment + will implement Wrapper.
+  + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class Summary
ClassCacheCache of generated classes and data structures to access Java runtime + from JavaScript.
CompilerEnvirons 
ContextThis class represents the runtime context of an executing script.
ContextFactoryFactory class that Rhino runtime uses to create new Context + instances.
FunctionObject 
ImporterTopLevelClass ImporterTopLevel + + This class defines a ScriptableObject that can be instantiated + as a top-level ("global") object to provide functionality similar + to Java's "import" statement.
ScriptableObjectThis is the default implementation of the Scriptable interface.
SecurityControllerThis class describes the support needed to implement security.
SynchronizerThis class provides support for implementing Java-style synchronized + methods in Javascript.
WrapFactoryEmbeddings that wish to provide their own custom wrappings for Java + objects may extend this class and call + Context.setWrapFactory(WrapFactory) + Once an instance of this class or an extension of this class is enabled + for a given context (by calling setWrapFactory on that context), Rhino + will call the methods of this class whenever it needs to wrap a value + resulting from a call to a Java method or an access to a Java field.
+  + +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+Exception Summary
EcmaErrorThe class of exceptions raised by the engine as described in + ECMA edition 3.
EvaluatorExceptionThe class of exceptions thrown by the JavaScript engine.
JavaScriptExceptionJava reflection of JavaScript exceptions.
RhinoExceptionThe class of exceptions thrown by the JavaScript engine.
WrappedExceptionA wrapper for runtime exceptions.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html new file mode 100644 index 0000000..030f3e0 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/package-tree.html @@ -0,0 +1,185 @@ + + + + + + +org.mozilla.javascript Class Hierarchy (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.mozilla.javascript +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+ +

+Interface Hierarchy +

+ +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html new file mode 100644 index 0000000..f0d178f --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableInputStream.html @@ -0,0 +1,373 @@ + + + + + + +ScriptableInputStream (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript.serialize +
+Class ScriptableInputStream

+
+java.lang.Object
+  extended by java.io.InputStream
+      extended by java.io.ObjectInputStream
+          extended by org.mozilla.javascript.serialize.ScriptableInputStream
+
+
+
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput, java.io.ObjectInput, java.io.ObjectStreamConstants
+
+
+
+
public class ScriptableInputStream
extends java.io.ObjectInputStream
+ + +

+Class ScriptableInputStream is used to read in a JavaScript + object or function previously serialized with a ScriptableOutputStream. + References to names in the exclusion list + replaced with references to the top-level scope specified during + creation of the ScriptableInputStream. +

+ +

+

+
Author:
+
Norris Boyd
+
+
+ +

+ + + + + + + +
+Nested Class Summary
+ + + + + + + +
Nested classes/interfaces inherited from class java.io.ObjectInputStream
java.io.ObjectInputStream.GetField
+  + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
+  + + + + + + + + + + +
+Constructor Summary
ScriptableInputStream(java.io.InputStream in, + Scriptable scope) + +
+          Create a ScriptableInputStream.
+  + + + + + + + + + + + + + + + +
+Method Summary
+protected  java.lang.ClassresolveClass(java.io.ObjectStreamClass desc) + +
+           
+protected  java.lang.ObjectresolveObject(java.lang.Object obj) + +
+           
+ + + + + + + +
Methods inherited from class java.io.ObjectInputStream
available, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveProxyClass, skipBytes
+ + + + + + + +
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+ + + + + + + +
Methods inherited from interface java.io.ObjectInput
read, skip
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ScriptableInputStream

+
+public ScriptableInputStream(java.io.InputStream in,
+                             Scriptable scope)
+                      throws java.io.IOException
+
+
Create a ScriptableInputStream. +

+

+
Parameters:
in - the InputStream to read from.
scope - the top-level scope to create the object in. +
Throws: +
java.io.IOException
+
+ + + + + + + + +
+Method Detail
+ +

+resolveClass

+
+protected java.lang.Class resolveClass(java.io.ObjectStreamClass desc)
+                                throws java.io.IOException,
+                                       java.lang.ClassNotFoundException
+
+
+
Overrides:
resolveClass in class java.io.ObjectInputStream
+
+
+ +
Throws: +
java.io.IOException +
java.lang.ClassNotFoundException
+
+
+
+ +

+resolveObject

+
+protected java.lang.Object resolveObject(java.lang.Object obj)
+                                  throws java.io.IOException
+
+
+
Overrides:
resolveObject in class java.io.ObjectInputStream
+
+
+ +
Throws: +
java.io.IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html new file mode 100644 index 0000000..fb6d1ba --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/ScriptableOutputStream.html @@ -0,0 +1,458 @@ + + + + + + +ScriptableOutputStream (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +

+ +org.mozilla.javascript.serialize +
+Class ScriptableOutputStream

+
+java.lang.Object
+  extended by java.io.OutputStream
+      extended by java.io.ObjectOutputStream
+          extended by org.mozilla.javascript.serialize.ScriptableOutputStream
+
+
+
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.io.ObjectOutput, java.io.ObjectStreamConstants
+
+
+
+
public class ScriptableOutputStream
extends java.io.ObjectOutputStream
+ + +

+Class ScriptableOutputStream is an ObjectOutputStream used + to serialize JavaScript objects and functions. Note that + compiled functions currently cannot be serialized, only + interpreted functions. The top-level scope containing the + object is not written out, but is instead replaced with + another top-level object when the ScriptableInputStream + reads in this object. Also, object corresponding to names + added to the exclude list are not written out but instead + are looked up during deserialization. This approach avoids + the creation of duplicate copies of standard objects + during deserialization. +

+ +

+

+
Author:
+
Norris Boyd
+
+
+ +

+ + + + + + + +
+Nested Class Summary
+ + + + + + + +
Nested classes/interfaces inherited from class java.io.ObjectOutputStream
java.io.ObjectOutputStream.PutField
+  + + + + + + + +
+Field Summary
+ + + + + + + +
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_ENUM, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_ENUM, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
+  + + + + + + + + + + +
+Constructor Summary
ScriptableOutputStream(java.io.OutputStream out, + Scriptable scope) + +
+          ScriptableOutputStream constructor.
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+ voidaddExcludedName(java.lang.String name) + +
+          Adds a qualified name to the list of object to be excluded from + serialization.
+ voidaddOptionalExcludedName(java.lang.String name) + +
+          Adds a qualified name to the list of object to be excluded from + serialization.
+ voidexcludeStandardObjectNames() + +
+          Adds the names of the standard objects and their + prototypes to the list of excluded names.
+ booleanhasExcludedName(java.lang.String name) + +
+          Returns true if the name is excluded from serialization.
+ voidremoveExcludedName(java.lang.String name) + +
+          Removes a name from the list of names to exclude.
+protected  java.lang.ObjectreplaceObject(java.lang.Object obj) + +
+           
+ + + + + + + +
Methods inherited from class java.io.ObjectOutputStream
annotateClass, annotateProxyClass, close, defaultWriteObject, drain, enableReplaceObject, flush, putFields, reset, useProtocolVersion, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeClassDescriptor, writeDouble, writeFields, writeFloat, writeInt, writeLong, writeObject, writeObjectOverride, writeShort, writeStreamHeader, writeUnshared, writeUTF
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Constructor Detail
+ +

+ScriptableOutputStream

+
+public ScriptableOutputStream(java.io.OutputStream out,
+                              Scriptable scope)
+                       throws java.io.IOException
+
+
ScriptableOutputStream constructor. + Creates a ScriptableOutputStream for use in serializing + JavaScript objects. Calls excludeStandardObjectNames. +

+

+
Parameters:
out - the OutputStream to write to.
scope - the scope containing the object. +
Throws: +
java.io.IOException
+
+ + + + + + + + +
+Method Detail
+ +

+addOptionalExcludedName

+
+public void addOptionalExcludedName(java.lang.String name)
+
+
Adds a qualified name to the list of object to be excluded from + serialization. Names excluded from serialization are looked up + in the new scope and replaced upon deserialization. +

+

+
Parameters:
name - a fully qualified name (of the form "a.b.c", where + "a" must be a property of the top-level object). The object + need not exist, in which case the name is ignored. +
Throws: +
java.lang.IllegalArgumentException - if the object is not a + Scriptable.
+
+
+
+ +

+addExcludedName

+
+public void addExcludedName(java.lang.String name)
+
+
Adds a qualified name to the list of object to be excluded from + serialization. Names excluded from serialization are looked up + in the new scope and replaced upon deserialization. +

+

+
Parameters:
name - a fully qualified name (of the form "a.b.c", where + "a" must be a property of the top-level object) +
Throws: +
java.lang.IllegalArgumentException - if the object is not found or is not + a Scriptable.
+
+
+
+ +

+hasExcludedName

+
+public boolean hasExcludedName(java.lang.String name)
+
+
Returns true if the name is excluded from serialization. +

+

+
+
+
+
+ +

+removeExcludedName

+
+public void removeExcludedName(java.lang.String name)
+
+
Removes a name from the list of names to exclude. +

+

+
+
+
+
+ +

+excludeStandardObjectNames

+
+public void excludeStandardObjectNames()
+
+
Adds the names of the standard objects and their + prototypes to the list of excluded names. +

+

+
+
+
+
+ +

+replaceObject

+
+protected java.lang.Object replaceObject(java.lang.Object obj)
+                                  throws java.io.IOException
+
+
+
Overrides:
replaceObject in class java.io.ObjectOutputStream
+
+
+ +
Throws: +
java.io.IOException
+
+
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html new file mode 100644 index 0000000..39d85e2 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-frame.html @@ -0,0 +1,34 @@ + + + + + + +org.mozilla.javascript.serialize (Rhino) + + + + + + + + + + + +org.mozilla.javascript.serialize + + + + +
+Classes  + +
+ScriptableInputStream +
+ScriptableOutputStream
+ + + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html new file mode 100644 index 0000000..568f562 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-summary.html @@ -0,0 +1,161 @@ + + + + + + +org.mozilla.javascript.serialize (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+

+Package org.mozilla.javascript.serialize +

+ + + + + + + + + + + + + +
+Class Summary
ScriptableInputStreamClass ScriptableInputStream is used to read in a JavaScript + object or function previously serialized with a ScriptableOutputStream.
ScriptableOutputStreamClass ScriptableOutputStream is an ObjectOutputStream used + to serialize JavaScript objects and functions.
+  + +

+

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + diff --git a/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html new file mode 100644 index 0000000..e672261 --- /dev/null +++ b/trunk/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/serialize/package-tree.html @@ -0,0 +1,163 @@ + + + + + + +org.mozilla.javascript.serialize Class Hierarchy (Rhino) + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+
+

+Hierarchy For Package org.mozilla.javascript.serialize +

+
+
+
Package Hierarchies:
All Packages
+
+

+Class Hierarchy +

+
    +
  • java.lang.Object
      +
    • java.io.InputStream (implements java.io.Closeable) +
        +
      • java.io.ObjectInputStream (implements java.io.ObjectInput, java.io.ObjectStreamConstants) + +
      +
    • java.io.OutputStream (implements java.io.Closeable, java.io.Flushable) +
        +
      • java.io.ObjectOutputStream (implements java.io.ObjectOutput, java.io.ObjectStreamConstants) + +
      +
    +
+
+ + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + -- cgit v1.2.3