org.mozilla.javascript
Class InterpretedScript

java.lang.Object
  |
  +--org.mozilla.javascript.ScriptableObject
        |
        +--org.mozilla.javascript.IdScriptable
              |
              +--org.mozilla.javascript.BaseFunction
                    |
                    +--org.mozilla.javascript.NativeFunction
                          |
                          +--org.mozilla.javascript.NativeScript
                                |
                                +--org.mozilla.javascript.InterpretedScript
All Implemented Interfaces:
DebuggableScript, Function, IdFunctionMaster, Script, Scriptable, java.io.Serializable

public class InterpretedScript
extends NativeScript
implements DebuggableScript

See Also:
Serialized Form

Fields inherited from class org.mozilla.javascript.NativeFunction
debug_level, debug_srcName, nestedFunctions
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
DONTENUM, EMPTY, PERMANENT, READONLY
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Method Summary
 java.lang.Object call(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
          Should be overridden.
 java.lang.Object exec(Context cx, Scriptable scope)
          Execute the script.
 int[] getLineNumbers()
          Get array containing the line numbers that can have breakpoints placed on them.
 Scriptable getScriptable()
          Get the Scriptable object (Function or Script) that is described by this DebuggableScript object.
 java.lang.String getSourceName()
          Get the name of the source (usually filename or URL) of the script.
 boolean isFunction()
          Returns true if this is a function, false if it is a script.
 boolean placeBreakpoint(int line)
          Place a breakpoint at the given line.
 boolean removeBreakpoint(int line)
          Remove a breakpoint from the given line.
 
Methods inherited from class org.mozilla.javascript.NativeScript
compile, construct, execMethod, getClassName, getFunctionName, init, initScript, methodArity
 
Methods inherited from class org.mozilla.javascript.NativeFunction
decompile, getArity, getLength, jsGet_name
 
Methods inherited from class org.mozilla.javascript.BaseFunction
hasInstance, setImmunePrototypeProperty
 
Methods inherited from class org.mozilla.javascript.IdScriptable
addAsPrototype, defineProperty, delete, get, getAttributes, has, put, setAttributes
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
equals, 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
 

Method Detail

exec

public java.lang.Object exec(Context cx,
                             Scriptable scope)
                      throws JavaScriptException
Description copied from class: NativeScript
Execute the script. Will be overridden by generated scripts; needed to implement Script.
Overrides:
exec in class NativeScript
Following copied from interface: org.mozilla.javascript.Script
Parameters:
cx - the Context associated with the current thread
scope - the scope to execute relative to
Returns:
the result of executing the script
Throws:
JavaScriptException - if an uncaught JavaScript exception occurred while executing the script
See Also:
Context.initStandardObjects(org.mozilla.javascript.ScriptableObject)

call

public java.lang.Object call(Context cx,
                             Scriptable scope,
                             Scriptable thisObj,
                             java.lang.Object[] args)
                      throws JavaScriptException
Description copied from class: BaseFunction
Should be overridden.
Overrides:
call in class NativeScript
Following copied from interface: org.mozilla.javascript.Function
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
Throws:
JavaScriptException - if an uncaught exception occurred while executing the function

isFunction

public boolean isFunction()
Description copied from interface: DebuggableScript
Returns true if this is a function, false if it is a script.
Specified by:
isFunction in interface DebuggableScript

getScriptable

public Scriptable getScriptable()
Description copied from interface: DebuggableScript
Get the Scriptable object (Function or Script) that is described by this DebuggableScript object.
Specified by:
getScriptable in interface DebuggableScript

getSourceName

public java.lang.String getSourceName()
Description copied from interface: DebuggableScript
Get the name of the source (usually filename or URL) of the script.
Specified by:
getSourceName in interface DebuggableScript

getLineNumbers

public int[] getLineNumbers()
Description copied from interface: DebuggableScript
Get array containing the line numbers that can have breakpoints placed on them.
Specified by:
getLineNumbers in interface DebuggableScript

placeBreakpoint

public boolean placeBreakpoint(int line)
Description copied from interface: DebuggableScript
Place a breakpoint at the given line.
Specified by:
placeBreakpoint in interface DebuggableScript
Following copied from interface: org.mozilla.javascript.debug.DebuggableScript
Returns:
true if the breakpoint was successfully set.

removeBreakpoint

public boolean removeBreakpoint(int line)
Description copied from interface: DebuggableScript
Remove a breakpoint from the given line.
Specified by:
removeBreakpoint in interface DebuggableScript
Following copied from interface: org.mozilla.javascript.debug.DebuggableScript
Returns:
true if there was a breakpoint at the given line.