org.apache.bsf.engines.javaclass

## Class JavaClassEngine

- java.lang.Object
- - org.apache.bsf.util.BSFEngineImpl
  - - org.apache.bsf.engines.javaclass.JavaClassEngine

- All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.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

- - ### Field Summary

    - ### Fields inherited from class org.apache.bsf.util.BSFEngineImpl

      `classLoader, classPath, declaredBeans, lang, mgr, tempDir`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaClassEngine()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `call(java.lang.Object object, java.lang.String method, java.lang.Object[] args)` call the named method of the given object.
    `java.lang.Object` | `eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object oscript)` This is used by an application to evaluate an object containing some expression - clearly not possible for compiled code ..

    - ### Methods inherited from class org.apache.bsf.util.BSFEngineImpl

      `apply, compileApply, compileExpr, compileScript, declareBean, exec, iexec, initialize, propertyChange, terminate, undeclareBean`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaClassEngine

          public JavaClassEngine()

  - ### Method Detail

    - #### call

          public java.lang.Object call(java.lang.Object object,
                                       java.lang.String method,
                                       java.lang.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 java.lang.Object eval(java.lang.String source,
                                       int lineNo,
                                       int columnNo,
                                       java.lang.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.