com.judoscript
Class BSFJudoEngine

java.lang.Object
  |
  +--com.ibm.bsf.util.BSFEngineImpl
        |
        +--com.judoscript.BSFJudoEngine
All Implemented Interfaces:
com.ibm.bsf.BSFEngine, java.util.EventListener, java.beans.PropertyChangeListener

public class BSFJudoEngine
extends com.ibm.bsf.util.BSFEngineImpl

This is the interface for BSF. Need to have IBM's BSF package in the classpath.


Fields inherited from class com.ibm.bsf.util.BSFEngineImpl
classLoader, classPath, debug, debugStream, declaredBeans, lang, mgr, tempDir
 
Constructor Summary
BSFJudoEngine()
           
 
Method Summary
 java.lang.Object call(java.lang.Object object, java.lang.String fxn, java.lang.Object[] args)
          Calls a function.
 void declareBean(com.ibm.bsf.BSFDeclaredBean bean)
          Declare a bean.
 java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Evaluates an expression.
 void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Executes a script.
 void initialize(com.ibm.bsf.BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans)
          Initializes the engine.
 void undeclareBean(com.ibm.bsf.BSFDeclaredBean bean)
          Undeclare a previously declared bean.
 
Methods inherited from class com.ibm.bsf.util.BSFEngineImpl
apply, compileApply, compileExpr, compileScript, propertyChange, setDebug, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSFJudoEngine

public BSFJudoEngine()
Method Detail

initialize

public void initialize(com.ibm.bsf.BSFManager mgr,
                       java.lang.String lang,
                       java.util.Vector declaredBeans)
                throws com.ibm.bsf.BSFException
Initializes the engine. Establishes the one and only $$bsf object in JudoScript, and sets all the declared beans as global variables.
Overrides:
initialize in class com.ibm.bsf.util.BSFEngineImpl
Parameters:
mgr - the BSF manager.
lang - always "judoscript".
declaredBeans - objects to set during initialization; elements are instances of com.ibm.bsf.DeclaredBean.

eval

public java.lang.Object eval(java.lang.String source,
                             int lineNo,
                             int columnNo,
                             java.lang.Object script)
                      throws com.ibm.bsf.BSFException
Evaluates an expression.
Overrides:
eval in class com.ibm.bsf.util.BSFEngineImpl
Parameters:
source - the file name of the expression; not used.
lineNo - the line number in the file; not used.
columnNo - the column number in the file; not used.
script - the expression; should be a String.
Returns:
the result of the expression.

exec

public void exec(java.lang.String source,
                 int lineNo,
                 int columnNo,
                 java.lang.Object script)
          throws com.ibm.bsf.BSFException
Executes a script.
Overrides:
exec in class com.ibm.bsf.util.BSFEngineImpl
Parameters:
source - the file name of the expression; not used.
lineNo - the line number in the file; not used.
columnNo - the column number in the file; not used.
script - the script code; should be a String.

call

public java.lang.Object call(java.lang.Object object,
                             java.lang.String fxn,
                             java.lang.Object[] args)
                      throws com.ibm.bsf.BSFException
Calls a function. (Calling object's methods is not supported.)
Overrides:
call in class com.ibm.bsf.util.BSFEngineImpl
Parameters:
object - is the name of the object; not used.
fxn - the function name.
args - the arguments.
Returns:
the result.

declareBean

public void declareBean(com.ibm.bsf.BSFDeclaredBean bean)
                 throws com.ibm.bsf.BSFException
Declare a bean. Sets the bean as a global variable in JudoScript.
Overrides:
declareBean in class com.ibm.bsf.util.BSFEngineImpl

undeclareBean

public void undeclareBean(com.ibm.bsf.BSFDeclaredBean bean)
                   throws com.ibm.bsf.BSFException
Undeclare a previously declared bean. Removes the named global variable from JudoScript.
Overrides:
undeclareBean in class com.ibm.bsf.util.BSFEngineImpl