public class JythonEngine extends BSFEngineImpl
classLoader, classPath, declaredBeans, lang, mgr, tempDir
Constructor and Description |
---|
JythonEngine() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
apply(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object funcBody,
java.util.Vector paramNames,
java.util.Vector arguments)
Evaluate an anonymous function (differs from eval() in that apply()
handles multiple lines).
|
java.lang.Object |
call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
call the named method of the given object.
|
void |
declareBean(BSFDeclaredBean bean)
Declare a bean
|
java.lang.Object |
eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Evaluate an expression.
|
void |
exec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Execute a script.
|
void |
iexec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Execute script code, emulating console interaction.
|
void |
initialize(BSFManager mgr,
java.lang.String lang,
java.util.Vector declaredBeans)
Initialize the engine.
|
void |
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean.
|
java.lang.Object |
unwrap(PyObject result) |
compileApply, compileExpr, compileScript, propertyChange, terminate
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 callmethod
- name of the method / procedure to callargs
- the arguments to be given to the procedureBSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public void declareBean(BSFDeclaredBean bean) throws BSFException
declareBean
in interface BSFEngine
declareBean
in class BSFEngineImpl
bean
- the bean to declareBSFException
- if the engine cannot do this operationpublic java.lang.Object apply(java.lang.String source, int lineNo, int columnNo, java.lang.Object funcBody, java.util.Vector paramNames, java.util.Vector arguments) throws BSFException
apply
in interface BSFEngine
apply
in class BSFEngineImpl
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 exprfuncBody
- the multi-line, value returning script to evaluateparamNames
- the names of the parameters above assumesarguments
- values of the above parametersBSFException
- if anything goes wrong while doin' it.public java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object script) 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 exprscript
- the expression to evaluateBSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script) throws BSFException
exec
in interface BSFEngine
exec
in class BSFEngineImpl
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 exprscript
- the script to executeBSFException
- if anything goes wrong while exec'ing a
BSFException is thrown. The reason indicates the problem.public void iexec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script) throws BSFException
iexec
in interface BSFEngine
iexec
in class BSFEngineImpl
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 exprscript
- the script to executeBSFException
- if anything goes wrong while exec'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
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
undeclareBean
in interface BSFEngine
undeclareBean
in class BSFEngineImpl
bean
- the bean to undeclareBSFException
- if the engine cannot do this operationpublic java.lang.Object unwrap(PyObject result)