org.apache.bsf.test
Class fakeEngine
java.lang.Object
org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.test.fakeEngine
- All Implemented Interfaces:
- BSFEngine, java.util.EventListener, java.beans.PropertyChangeListener
- public class fakeEngine
- extends BSFEngineImpl
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. |
java.lang.Object |
eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object expr)
This is used by an application to evaluate an expression. |
void |
exec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Default impl of execute - calls eval and ignores the result. |
void |
iexec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
Default impl of interactive execution - calls eval and ignores the result. |
void |
terminate()
Graceful termination |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fakeEngine
public fakeEngine()
call
public java.lang.Object call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
throws BSFException
- Description copied from interface:
BSFEngine
- 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.
- Parameters:
object
- object on which to make the callmethod
- name of the method / procedure to callargs
- the arguments to be given to the procedure
- Throws:
BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.
eval
public java.lang.Object eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object expr)
throws BSFException
- Description copied from interface:
BSFEngine
- 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.)
- 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:
BSFException
- if anything goes wrong while eval'ing a
BSFException is thrown. The reason indicates the problem.
iexec
public void iexec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
throws BSFException
- Description copied from class:
BSFEngineImpl
- Default impl of interactive execution - calls eval and ignores the result.
- Specified by:
iexec
in interface BSFEngine
- Overrides:
iexec
in class BSFEngineImpl
- Throws:
BSFException
exec
public void exec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
throws BSFException
- Description copied from class:
BSFEngineImpl
- Default impl of execute - calls eval and ignores the result.
- Specified by:
exec
in interface BSFEngine
- Overrides:
exec
in class BSFEngineImpl
- Throws:
BSFException
terminate
public void terminate()
- Description copied from interface:
BSFEngine
- Graceful termination
- Specified by:
terminate
in interface BSFEngine
- Overrides:
terminate
in class BSFEngineImpl