public class JavaScriptEngine extends BSFEngineImpl
The original version of this code was first written by Adam Peller for use in LotusXSL. Sanjiva took his code and adapted it for BSF.
classLoader, classPath, dbgmgr, declaredBeans, lang, mgr, tempDir| Constructor and Description |
|---|
JavaScriptEngine() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
Return an object from an extension.
|
void |
declareBean(BSFDeclaredBean bean)
Declare a bean after the engine has been started.
|
void |
disconnectedDebuggerNotify()
Basic engines are not supporting breakpoints for the meaning
and support is something that is language-specific.
|
java.lang.Object |
eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object oscript)
This is used by an application to evaluate a string containing
some expression.
|
java.lang.Object |
getSpecificDebuggingInterface()
By default, an engine does not support debugging.
|
void |
initialize(BSFManager mgr,
java.lang.String lang,
java.util.Vector declaredBeans)
initialize the engine.
|
void |
placeBreakpointAtLine(int brkptid,
java.lang.String docname,
int lineno) |
void |
placeBreakpointAtOffset(int brkptid,
java.lang.String docname,
int offset) |
void |
removeBreakpoint(java.lang.String docname,
int brkptid) |
void |
setEntryExit(java.lang.String docname,
boolean on) |
void |
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean.
|
apply, compileApply, compileExpr, compileScript, exec, propertyChange, terminatepublic void disconnectedDebuggerNotify()
BSFEngineImpldisconnectedDebuggerNotify in interface BSFEnginedisconnectedDebuggerNotify in class BSFEngineImplpublic void placeBreakpointAtLine(int brkptid,
java.lang.String docname,
int lineno)
throws BSFException
placeBreakpointAtLine in interface BSFEngineplaceBreakpointAtLine in class BSFEngineImplBSFExceptionpublic void placeBreakpointAtOffset(int brkptid,
java.lang.String docname,
int offset)
throws BSFException
placeBreakpointAtOffset in interface BSFEngineplaceBreakpointAtOffset in class BSFEngineImplBSFExceptionpublic void removeBreakpoint(java.lang.String docname,
int brkptid)
throws BSFException
removeBreakpoint in interface BSFEngineremoveBreakpoint in class BSFEngineImplBSFExceptionpublic void setEntryExit(java.lang.String docname,
boolean on)
throws BSFException
setEntryExit in interface BSFEnginesetEntryExit in class BSFEngineImplBSFExceptionpublic java.lang.Object call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
throws BSFException
object - Object on which to make the call (ignored).method - The name of the method to call.args - an array of arguments to be
passed to the extension, which may be either
Vectors of Nodes, or Strings.BSFException - if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public void declareBean(BSFDeclaredBean bean) throws BSFException
BSFEnginedeclareBean in interface BSFEnginedeclareBean in class BSFEngineImplbean - the bean to declareBSFException - if the engine cannot do this operationpublic java.lang.Object eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object oscript)
throws BSFException
source - (context info) the source of this expression
(e.g., filename)lineNo - (context info) the line number in source for exprcolumnNo - (context info) the column number in source for exproscript - the expression to evaluateBSFException - if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public java.lang.Object getSpecificDebuggingInterface()
BSFEngineImplgetSpecificDebuggingInterface in interface BSFEnginegetSpecificDebuggingInterface in class BSFEngineImplpublic void initialize(BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans) throws BSFException
initialize in interface BSFEngineinitialize in class BSFEngineImplmgr - The BSFManager that's hosting this engine.lang - Language string which this engine is handling.declaredBeans - Vector of BSFDeclaredObject containing beans
that should be declared into the language runtime at init
time as best as possible.BSFException - if anything goes wrong while init'ing a
BSFException is thrown. The reason indicates the problem.public void undeclareBean(BSFDeclaredBean bean) throws BSFException
BSFEngineundeclareBean in interface BSFEngineundeclareBean in class BSFEngineImplbean - the bean to undeclareBSFException - if the engine cannot do this operation