org.ofbiz.minilang
Class SimpleMethodBsfEngine

java.lang.Object
  extended by BSFEngineImpl
      extended by org.ofbiz.minilang.SimpleMethodBsfEngine

public class SimpleMethodBsfEngine
extends BSFEngineImpl

This is the OFBiz MiniLang SimpleMethod adapter for IBM's Bean Scripting Famework. It is an implementation of the BSFEngine class, allowing BSF aware applications to use SimpleMethod as a scripting language.

There should only be ONE simple-method in the XML file and it will be run as an event.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> context
           
static java.lang.String module
           
 
Constructor Summary
SimpleMethodBsfEngine()
           
 
Method Summary
 java.lang.Object apply(java.lang.String source, int lineNo, int columnNo, java.lang.Object funcBody, java.util.Vector namesVec, java.util.Vector argsVec)
          This is an implementation of the apply() method.
 java.lang.Object call(java.lang.Object object, java.lang.String name, java.lang.Object[] args)
          Invoke method name on the specified scripted object.
 void declareBean(BSFDeclaredBean bean)
           
 java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object expr)
           
 void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
           
 void initialize(BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans)
           
 void setDebug(boolean debug)
           
 void terminate()
           
 void undeclareBean(BSFDeclaredBean bean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

context

protected java.util.Map<java.lang.String,java.lang.Object> context
Constructor Detail

SimpleMethodBsfEngine

public SimpleMethodBsfEngine()
Method Detail

initialize

public void initialize(BSFManager mgr,
                       java.lang.String lang,
                       java.util.Vector declaredBeans)
                throws BSFException
Throws:
BSFException

setDebug

public void setDebug(boolean debug)

call

public java.lang.Object call(java.lang.Object object,
                             java.lang.String name,
                             java.lang.Object[] args)
                      throws BSFException
Invoke method name on the specified scripted object. The object may be null to indicate the global namespace of the interpreter.

Parameters:
object - may be null for the global namespace.
Throws:
BSFException

apply

public java.lang.Object apply(java.lang.String source,
                              int lineNo,
                              int columnNo,
                              java.lang.Object funcBody,
                              java.util.Vector namesVec,
                              java.util.Vector argsVec)
                       throws BSFException
This is an implementation of the apply() method. It exectutes the funcBody text in an "anonymous" method call with arguments.

Throws:
BSFException

eval

public java.lang.Object eval(java.lang.String source,
                             int lineNo,
                             int columnNo,
                             java.lang.Object expr)
                      throws BSFException
Throws:
BSFException

exec

public void exec(java.lang.String source,
                 int lineNo,
                 int columnNo,
                 java.lang.Object script)
          throws BSFException
Throws:
BSFException

declareBean

public void declareBean(BSFDeclaredBean bean)
                 throws BSFException
Throws:
BSFException

undeclareBean

public void undeclareBean(BSFDeclaredBean bean)
                   throws BSFException
Throws:
BSFException

terminate

public void terminate()