pnuts.ext
Class PnutsBSFEngine
java.lang.Object
|
+--com.ibm.bsf.util.BSFEngineImpl
|
+--pnuts.ext.PnutsBSFEngine
- All Implemented Interfaces:
- com.ibm.bsf.BSFEngine, java.util.EventListener, java.beans.PropertyChangeListener
- public class PnutsBSFEngine
- extends com.ibm.bsf.util.BSFEngineImpl
This is the interface to Pnuts from Bean Scripting Framework.
- See Also:
- Pnuts User's Guide,
BSFEngine
,
Package
,
Context
Fields inherited from class com.ibm.bsf.util.BSFEngineImpl |
classLoader, classPath, debug, debugStream, declaredBeans, lang, mgr, tempDir |
Method Summary |
java.lang.Object |
call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
This is used by an application to call into the scripting engine
to make a function/method call. |
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)
This is used by an application to evaluate an expression. |
void |
setDebug(boolean debug)
Turn on/off debugging output to System.err. |
void |
undeclareBean(com.ibm.bsf.BSFDeclaredBean bean)
Undeclare a previously declared bean. |
Methods inherited from class com.ibm.bsf.util.BSFEngineImpl |
compileExpr, compileScript, exec, initialize, propertyChange |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PnutsBSFEngine
public PnutsBSFEngine()
eval
public java.lang.Object eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
throws com.ibm.bsf.BSFException
- This is used by an application to evaluate an expression. The
expression may be string or some other type, depending on the
language. (For example, for BML it'll be an org.w3c.dom.Element
object.)
- Overrides:
eval
in class com.ibm.bsf.util.BSFEngineImpl
- Parameters:
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 exprexpr
- the expression to evaluate- Throws:
com.ibm.bsf.BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.
call
public java.lang.Object call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
throws com.ibm.bsf.BSFException
- This is used by an application to call into the scripting engine
to make a function/method call. The "object" argument is the object
whose method is to be called, if that applies. For non-OO languages,
this is typically ignored and should be given as null. For pretend-OO
languages such as VB, this would be the (String) name of the object.
The arguments are given in the args array.
- Overrides:
call
in class com.ibm.bsf.util.BSFEngineImpl
- Parameters:
object
- object on which to make the callname
- name of the method / procedure to callargs
- the arguments to be given to the procedure- Throws:
com.ibm.bsf.BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.
declareBean
public void declareBean(com.ibm.bsf.BSFDeclaredBean bean)
throws com.ibm.bsf.BSFException
- Declare a bean
- 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.
- Overrides:
undeclareBean
in class com.ibm.bsf.util.BSFEngineImpl
setDebug
public void setDebug(boolean debug)
- Turn on/off debugging output to System.err.
- Overrides:
setDebug
in class com.ibm.bsf.util.BSFEngineImpl