|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.bsf.util.BSFEngineImpl | +--com.ibm.bsf.engines.javascript.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 com.ibm.bsf.util.BSFEngineImpl |
classLoader, classPath, debug, debugStream, 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. |
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. |
void |
initialize(BSFManager mgr,
java.lang.String lang,
java.util.Vector declaredBeans)
initialize the engine. |
void |
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean. |
Methods inherited from class com.ibm.bsf.util.BSFEngineImpl |
apply, compileApply, compileExpr, compileScript, exec, propertyChange, setDebug, 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 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 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 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 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 |