org.apache.jmeter.util

## Class BeanShellInterpreter

- java.lang.Object
- - org.apache.jmeter.util.BeanShellInterpreter

-     public class BeanShellInterpreter
      extends Object

  BeanShell setup function - encapsulates all the access to the BeanShell Interpreter in a single class. The class uses dynamic class loading to access BeanShell, which means that all the source files can be built without needing access to the bsh jar. If the beanshell jar is not present at run-time, an error will be logged

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BeanShellInterpreter()`
    `BeanShellInterpreter(String init, org.slf4j.Logger log)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `eval(String s)`
    `Object` | `evalNoLog(String s)`
    `Object` | `get(String s)`
    `static boolean` | `isInterpreterPresent()`
    `void` | `reset()` Resets the BeanShell interpreter.
    `Object` | `set(String s, boolean b)`
    `Object` | `set(String s, Object o)`
    `Object` | `source(String s)`

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

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

- - ### Constructor Detail

    - #### BeanShellInterpreter

          public BeanShellInterpreter()
                               throws ClassNotFoundException

      Throws:
        `ClassNotFoundException`

    - #### BeanShellInterpreter

          public BeanShellInterpreter(String init,
                                      org.slf4j.Logger log)
                               throws ClassNotFoundException

      Parameters:
        `init` - initialisation file
        `log` - logger to pass to interpreter
      Throws:
        `ClassNotFoundException` - when beanshell can not be instantiated

  - ### Method Detail

    - #### reset

          public void reset()
                     throws ClassNotFoundException

      Resets the BeanShell interpreter.
      Throws:
        `ClassNotFoundException` - if interpreter cannot be instantiated

    - #### eval

          public Object eval(String s)
                      throws JMeterException

      Throws:
        `JMeterException`

    - #### evalNoLog

          public Object evalNoLog(String s)
                           throws JMeterException

      Throws:
        `JMeterException`

    - #### set

          public Object set(String s,
                            Object o)
                     throws JMeterException

      Throws:
        `JMeterException`

    - #### set

          public Object set(String s,
                            boolean b)
                     throws JMeterException

      Throws:
        `JMeterException`

    - #### source

          public Object source(String s)
                        throws JMeterException

      Throws:
        `JMeterException`

    - #### get

          public Object get(String s)
                     throws JMeterException

      Throws:
        `JMeterException`

    - #### isInterpreterPresent

          public static boolean isInterpreterPresent()

Copyright © 1998-2022 Apache Software Foundation. All Rights Reserved.