|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.bsf.util.BSFEngineImpl
org.apache.bsf.engines.javascript.JavaScriptEngine
public class JavaScriptEngine
This is the interface to Netscape's Rhino (JavaScript) from the Bean Scripting Framework.
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.
Field Summary |
---|
Fields inherited from class org.apache.bsf.util.BSFEngineImpl |
---|
classLoader, classPath, dbgmgr, declaredBeans, lang, mgr, tempDir |
Constructor Summary | |
---|---|
JavaScriptEngine()
|
Method Summary | |
---|---|
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. put the manager into the context -> manager map hashtable too. |
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. |
Methods inherited from class org.apache.bsf.util.BSFEngineImpl |
---|
apply, compileApply, compileExpr, compileScript, exec, propertyChange, terminate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaScriptEngine()
Method Detail |
---|
public void disconnectedDebuggerNotify()
BSFEngineImpl
disconnectedDebuggerNotify
in interface BSFEngine
disconnectedDebuggerNotify
in class BSFEngineImpl
public void placeBreakpointAtLine(int brkptid, java.lang.String docname, int lineno) throws BSFException
placeBreakpointAtLine
in interface BSFEngine
placeBreakpointAtLine
in class BSFEngineImpl
BSFException
public void placeBreakpointAtOffset(int brkptid, java.lang.String docname, int offset) throws BSFException
placeBreakpointAtOffset
in interface BSFEngine
placeBreakpointAtOffset
in class BSFEngineImpl
BSFException
public void removeBreakpoint(java.lang.String docname, int brkptid) throws BSFException
removeBreakpoint
in interface BSFEngine
removeBreakpoint
in class BSFEngineImpl
BSFException
public void setEntryExit(java.lang.String docname, boolean on) throws BSFException
setEntryExit
in interface BSFEngine
setEntryExit
in class BSFEngineImpl
BSFException
public 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
BSFEngine
declareBean
in interface BSFEngine
declareBean
in class BSFEngineImpl
bean
- the bean to declare
BSFException
- 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 evaluate
BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public java.lang.Object getSpecificDebuggingInterface()
BSFEngineImpl
getSpecificDebuggingInterface
in interface BSFEngine
getSpecificDebuggingInterface
in class BSFEngineImpl
public void initialize(BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans) throws BSFException
initialize
in interface BSFEngine
initialize
in class BSFEngineImpl
mgr
- 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
BSFEngine
undeclareBean
in interface BSFEngine
undeclareBean
in class BSFEngineImpl
bean
- the bean to undeclare
BSFException
- if the engine cannot do this operation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |