Class AbstractReplScriptEngine

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
All Implemented Interfaces:
Comparable<org.eclipse.core.internal.jobs.InternalJob>, org.eclipse.core.runtime.IAdaptable, IReplEngine, IScriptEngine
Direct Known Subclasses:
JythonScriptEngine, NashornScriptEngine, Py4jScriptEngine, RhinoScriptEngine

public abstract class AbstractReplScriptEngine extends AbstractScriptEngine implements IReplEngine
Adds generic REPL support to the AbstractScriptEngine.
  • Constructor Details

    • AbstractReplScriptEngine

      public AbstractReplScriptEngine(String name)
      Constructor. Sets the name for the underlying job.
      Parameters:
      name - name of script engine job
  • Method Details

    • setTerminateOnIdle

      public final void setTerminateOnIdle(boolean terminate)
      Description copied from interface: IReplEngine
      Set a marker that the interpreter should terminate instead entering IDLE mode. If set, the interpreter will execute all pending requests and terminate afterwards.
      Specified by:
      setTerminateOnIdle in interface IReplEngine
      Parameters:
      terminate - true to request termination
    • getTerminateOnIdle

      public boolean getTerminateOnIdle()
      Description copied from interface: IReplEngine
      Get termination condition when engine is idle.
      Specified by:
      getTerminateOnIdle in interface IReplEngine
      Returns:
      true when engine is terminated when idle
    • terminate

      public void terminate()
      Description copied from interface: IScriptEngine
      Terminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.
      Specified by:
      terminate in interface IScriptEngine
      Overrides:
      terminate in class AbstractScriptEngine
    • getDefinedVariables

      public Collection<EaseDebugVariable> getDefinedVariables()
      Description copied from interface: IReplEngine
      Get variables defined on the top level scope of the script engine.
      Specified by:
      getDefinedVariables in interface IReplEngine
      Returns:
      defined variables
    • getType

      public ScriptObjectType getType(Object object)
      Description copied from interface: IReplEngine
      Get type information on a given script object.
      Specified by:
      getType in interface IReplEngine
      Parameters:
      object - object to inspect
      Returns:
      object type
    • toString

      public String toString(Object object)
      Description copied from interface: IReplEngine
      Get the String representation of a script object. A script object can be an execution result or a variable content.
      Specified by:
      toString in interface IReplEngine
      Parameters:
      object - script object
      Returns:
      String representation
    • getLastExecutionResult

      public EaseDebugVariable getLastExecutionResult()
      Description copied from interface: IReplEngine
      Get the result of the last script execution.
      Specified by:
      getLastExecutionResult in interface IReplEngine
      Returns:
      script result of last execution