Class BshScriptFactory

java.lang.Object
org.springframework.scripting.bsh.BshScriptFactory
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, ScriptFactory

public class BshScriptFactory extends Object implements ScriptFactory, org.springframework.beans.factory.BeanClassLoaderAware
ScriptFactory implementation for a BeanShell script.

Typically used in combination with a ScriptFactoryPostProcessor; see the latter's javadoc for a configuration example.

Since:
2.0
Author:
Juergen Hoeller, Rob Harrop
See Also:
  • Constructor Details

    • BshScriptFactory

      public BshScriptFactory(String scriptSourceLocator)
      Create a new BshScriptFactory for the given script source.

      With this BshScriptFactory variant, the script needs to declare a full class or return an actual instance of the scripted object.

      Parameters:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
    • BshScriptFactory

      public BshScriptFactory(String scriptSourceLocator, @Nullable Class<?>... scriptInterfaces)
      Create a new BshScriptFactory for the given script source.

      The script may either be a simple script that needs a corresponding proxy generated (implementing the specified interfaces), or declare a full class or return an actual instance of the scripted object (in which case the specified interfaces, if any, need to be implemented by that class/instance).

      Parameters:
      scriptSourceLocator - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
      scriptInterfaces - the Java interfaces that the scripted object is supposed to implement (may be null)
  • Method Details