|
20080913, rgf | ||||||||||
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
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, 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 org.apache.bsf.util.BSFEngineImpl |
apply, compileApply, compileExpr, compileScript, exec, iexec, 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 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
BSFException
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 void initialize(BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans) throws BSFException
initialize
in interface BSFEngine
initialize
in class BSFEngineImpl
BSFException
public void undeclareBean(BSFDeclaredBean bean) throws BSFException
BSFEngine
undeclareBean
in interface BSFEngine
undeclareBean
in class BSFEngineImpl
BSFException
|
20080913, rgf | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |