org.eclipse.ease.lang.javascript.rhino.debugger

## Class RhinoDebuggerEngine

- java.lang.Object
- - org.eclipse.core.runtime.PlatformObject
  - - org.eclipse.core.internal.jobs.InternalJob
    - - org.eclipse.core.runtime.jobs.Job
      - - org.eclipse.ease.AbstractScriptEngine
        - - org.eclipse.ease.AbstractReplScriptEngine
          - - org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine
            - - org.eclipse.ease.lang.javascript.rhino.debugger.RhinoDebuggerEngine

All Implemented Interfaces:
  java.lang.Comparable, IAdaptable, IDebugEngine, IReplEngine, IScriptEngine, org.mozilla.javascript.ContextFactory.Listener

    public class RhinoDebuggerEngine
    extends RhinoScriptEngine
    implements IDebugEngine, org.mozilla.javascript.ContextFactory.Listener

A script engine to execute/debug JavaScript code on a Rhino interpreter.

### Field Summary

Fields
`static java.lang.String` `ENGINE_ID`

### Fields inherited from class org.eclipse.core.runtime.jobs.Job

`ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING`

### Fields inherited from interface org.eclipse.ease.IScriptEngine

`TRACE_SCRIPT_ENGINE`

### Constructor Summary

Constructors
Constructor and Description
`RhinoDebuggerEngine()` Creates a new Rhino Debugger interpreter.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `contextCreated(org.mozilla.javascript.Context cx)`
`void` `contextReleased(org.mozilla.javascript.Context cx)`
`ScriptStackTrace` `getExceptionStackTrace()` Get the stack trace of the last thrown exception of the current thread.
`ScriptStackTrace` `getExceptionStackTrace(java.lang.Object thread)` Get the stack trace of the last thrown exception of the given thread.
`ScriptStackTrace` `getStackTrace()` Get the current stack trace.
`java.util.Collection<EaseDebugVariable>` `getVariables(java.lang.Object scope)` Get variables within a specific scope or child elements for a given object
`static boolean` `isSimpleType(java.lang.Object value)`
`java.lang.Object` `removeVariable(java.lang.String name)` Remove a variable from the scope.
`void` `setOptimizationLevel(int level)`
`void` `setupDebugger(ILaunch launch, boolean suspendOnStartup, boolean suspendOnScriptLoad, boolean showDynamicCode)`
`void` `setVariable(java.lang.String name, java.lang.Object content, org.mozilla.javascript.Scriptable scope)`

### Methods inherited from class org.eclipse.ease.lang.javascript.rhino.RhinoScriptEngine

`getContext, getScope, getType, getVariables, registerJar, terminateCurrent, toString`

### Methods inherited from class org.eclipse.ease.AbstractReplScriptEngine

`getDefinedVariables, getLastExecutionResult, getTerminateOnIdle, isIdle, setTerminateOnIdle, terminate`

### Methods inherited from class org.eclipse.ease.AbstractScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, extractArguments, getCurrentScriptEngine, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getOutputStream, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, removeExecutionListener, removeSecurityCheck, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariable`

### Methods inherited from class org.eclipse.core.runtime.jobs.Job

`addJobChangeListener, belongsTo, cancel, create, create, createSystem, createSystem, createSystem, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule`

### Methods inherited from class org.eclipse.core.internal.jobs.InternalJob

`compareTo`

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.ease.IScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getName, getOutputStream, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, registerJar, removeExecutionListener, removeSecurityCheck, schedule, setCloseStreamsOnTerminate, setErrorStream, setInputStream, setOutputStream, setVariable, terminate, terminateCurrent`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Field Detail

#### ENGINE_ID

    public static final java.lang.String ENGINE_ID

See Also:
  Constant Field Values

### Constructor Detail

#### RhinoDebuggerEngine

    public RhinoDebuggerEngine()

Creates a new Rhino Debugger interpreter.

### Method Detail

#### isSimpleType

    public static boolean isSimpleType(java.lang.Object value)

#### getVariables

    public java.util.Collection<EaseDebugVariable> getVariables(java.lang.Object scope)

Description copied from interface: `IDebugEngine`
Get variables within a specific scope or child elements for a given object

Specified by:
  `getVariables` in interface `IDebugEngine`
Parameters:
  `scope` - scope or parent object
Returns:
  variables assigned to scope

#### removeVariable

    public java.lang.Object removeVariable(java.lang.String name)

Description copied from interface: `IDebugEngine`
Remove a variable from the scope.

Specified by:
  `removeVariable` in interface `IDebugEngine`
Parameters:
  `name` - variable to be removed.
Returns:

#### setVariable

    public void setVariable(java.lang.String name,
                            java.lang.Object content,
                            org.mozilla.javascript.Scriptable scope)

#### setOptimizationLevel

    public void setOptimizationLevel(int level)

Overrides:
  `setOptimizationLevel` in class `RhinoScriptEngine`

#### setupDebugger

    public void setupDebugger(ILaunch launch,
                              boolean suspendOnStartup,
                              boolean suspendOnScriptLoad,
                              boolean showDynamicCode)

Specified by:
  `setupDebugger` in interface `IDebugEngine`

#### getStackTrace

    public ScriptStackTrace getStackTrace()

Description copied from interface: `IDebugEngine`
Get the current stack trace. A trace is a stack starting with the root file executed by the engine. Function calls and files (called via include command) will be put on top of that stack. Each entry may contain a pointer to the current line number executed. Traces might be created dynamically on demand or accumulated during execution depending on the underlying engine.

Specified by:
  `getStackTrace` in interface `IDebugEngine`
Overrides:
  `getStackTrace` in class `AbstractScriptEngine`
Returns:
  current stack trace

#### getExceptionStackTrace

    public ScriptStackTrace getExceptionStackTrace()

Description copied from interface: `IDebugEngine`
Get the stack trace of the last thrown exception of the current thread. Will be populated when an exception is thrown by the script engine. Can be evaluated in a try/catch statement within the script. Only available during script runtime.

Specified by:
  `getExceptionStackTrace` in interface `IDebugEngine`
Overrides:
  `getExceptionStackTrace` in class `RhinoScriptEngine`
Returns:
  last exception stack trace or `null`

#### getExceptionStackTrace

    public ScriptStackTrace getExceptionStackTrace(java.lang.Object thread)

Description copied from interface: `IDebugEngine`
Get the stack trace of the last thrown exception of the given thread. Will be populated when an exception is thrown by the script engine. Can be evaluated in a try/catch statement within the script. Only available during script runtime.

Specified by:
  `getExceptionStackTrace` in interface `IDebugEngine`
Parameters:
  `thread` - thread to get last exception stacktrace from
Returns:
  last exception stack trace or `null`

#### contextCreated

    public void contextCreated(org.mozilla.javascript.Context cx)

Specified by:
  `contextCreated` in interface `org.mozilla.javascript.ContextFactory.Listener`

#### contextReleased

    public void contextReleased(org.mozilla.javascript.Context cx)

Specified by:
  `contextReleased` in interface `org.mozilla.javascript.ContextFactory.Listener`