|
||||||||||
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.jython.JythonEngine
public class JythonEngine
This is the interface to Jython (http://www.jython.org/) from BSF. It's derived from the JPython 1.x engine
Field Summary |
---|
Fields inherited from class org.apache.bsf.util.BSFEngineImpl |
---|
classLoader, classPath, declaredBeans, lang, mgr, tempDir |
Constructor Summary | |
---|---|
JythonEngine()
|
Method Summary | |
---|---|
Object |
apply(String source,
int lineNo,
int columnNo,
Object funcBody,
Vector paramNames,
Vector arguments)
Evaluate an anonymous function (differs from eval() in that apply() handles multiple lines). |
Object |
call(Object object,
String method,
Object[] args)
call the named method of the given object. |
void |
declareBean(BSFDeclaredBean bean)
Declare a bean |
Object |
eval(String source,
int lineNo,
int columnNo,
Object script)
Evaluate an expression. |
void |
exec(String source,
int lineNo,
int columnNo,
Object script)
Execute a script. |
void |
iexec(String source,
int lineNo,
int columnNo,
Object script)
Execute script code, emulating console interaction. |
void |
initialize(BSFManager mgr,
String lang,
Vector declaredBeans)
Initialize the engine. |
void |
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean. |
Object |
unwrap(org.python.core.PyObject result)
|
Methods inherited from class org.apache.bsf.util.BSFEngineImpl |
---|
compileApply, compileExpr, compileScript, propertyChange, terminate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JythonEngine()
Method Detail |
---|
public Object call(Object object, String method, 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 procedure
BSFException
- 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 declare
BSFException
- if the engine cannot do this operationpublic Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, 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 parameters
BSFException
- if anything goes wrong while doin' it.public Object eval(String source, int lineNo, int columnNo, 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 evaluate
BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.public void exec(String source, int lineNo, int columnNo, 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 execute
BSFException
- if anything goes wrong while exec'ing a
BSFException is thrown. The reason indicates the problem.public void iexec(String source, int lineNo, int columnNo, 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 execute
BSFException
- if anything goes wrong while exec'ing a
BSFException is thrown. The reason indicates the problem.public void initialize(BSFManager mgr, String lang, 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 undeclare
BSFException
- if the engine cannot do this operationpublic Object unwrap(org.python.core.PyObject result)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |