Class JavaClassEngine

java.lang.Object
org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.engines.javaclass.JavaClassEngine
All Implemented Interfaces:
PropertyChangeListener, EventListener, BSFEngine

public class JavaClassEngine extends BSFEngineImpl
This is the interface to scripts consisting of Java objects from the Bean Scripting Framework.
Author:
Sanjiva Weerawarana
  • Constructor Details

    • JavaClassEngine

      public JavaClassEngine()
  • Method Details

    • call

      public Object call(Object object, String method, Object[] args) throws BSFException
      call the named method of the given object. If object is an instance of Class, then the call is a static call on that object. If not, its an instance method call or a static call (as per Java) on the given object.
      Parameters:
      object - object on which to make the call
      method - name of the method / procedure to call
      args - 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 Object eval(String source, int lineNo, int columnNo, Object oscript) throws BSFException
      This is used by an application to evaluate an object containing some expression - clearly not possible for compiled code ..
      Parameters:
      source - (context info) the source of this expression (e.g., filename)
      lineNo - (context info) the line number in source for expr
      columnNo - (context info) the column number in source for expr
      oscript - the expression to evaluate
      Throws:
      BSFException - if anything goes wrong while eval'ing a BSFException is thrown. The reason indicates the problem.