Class PythonScriptExecutor

java.lang.Object
org.springframework.integration.scripting.jsr223.AbstractScriptExecutor
org.springframework.integration.scripting.jsr223.PythonScriptExecutor
All Implemented Interfaces:
ScriptExecutor

@Deprecated(forRemoval=true, since="6.4") public class PythonScriptExecutor extends AbstractScriptExecutor
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of PolyglotScriptExecutor with a python language argument.
A ScriptExecutor that implements special handling required for Python to emulate behavior similar to other JSR223 scripting languages.

Script evaluation using the Jython implementation results in a null return value for normal variable expressions such as x=2. As a work around, it is necessary to get the value of 'x' explicitly following the script evaluation. This class performs simple parsing on the last line of the script to obtain the variable name, if any, and return its value.

Since:
2.1
Author:
David Turanski, Gary Russell, Artem Bilan
  • Constructor Details

    • PythonScriptExecutor

      public PythonScriptExecutor()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • postProcess

      protected Object postProcess(Object result, ScriptEngine scriptEngine, String script, Bindings bindings)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: AbstractScriptExecutor
      Subclasses may implement this to provide any special handling required
      Specified by:
      postProcess in class AbstractScriptExecutor
      Parameters:
      result - the result.
      scriptEngine - the engine.
      script - the script.
      bindings - the bindings.
      Returns:
      modified result