org.springframework.scripting.bsh

Class BshScriptEvaluator

  • java.lang.Object
    • org.springframework.scripting.bsh.BshScriptEvaluator
    • Constructor Summary

      Constructors 
      Constructor and Description
      BshScriptEvaluator()
      Construct a new BshScriptEvaluator.
      BshScriptEvaluator(java.lang.ClassLoader classLoader)
      Construct a new BshScriptEvaluator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object evaluate(ScriptSource script)
      Evaluate the given script.
      java.lang.Object evaluate(ScriptSource script, java.util.Map<java.lang.String,java.lang.Object> arguments)
      Evaluate the given script with the given arguments.
      void setBeanClassLoader(java.lang.ClassLoader classLoader)
      Callback that supplies the bean class loader to a bean instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BshScriptEvaluator

        public BshScriptEvaluator()
        Construct a new BshScriptEvaluator.
      • BshScriptEvaluator

        public BshScriptEvaluator(java.lang.ClassLoader classLoader)
        Construct a new BshScriptEvaluator.
        Parameters:
        classLoader - the ClassLoader to use for the Interpreter
    • Method Detail

      • evaluate

        @Nullable
        public java.lang.Object evaluate(ScriptSource script)
        Description copied from interface: ScriptEvaluator
        Evaluate the given script.
        Specified by:
        evaluate in interface ScriptEvaluator
        Parameters:
        script - the ScriptSource for the script to evaluate
        Returns:
        the return value of the script, if any
      • evaluate

        @Nullable
        public java.lang.Object evaluate(ScriptSource script,
                                                   @Nullable
                                                   java.util.Map<java.lang.String,java.lang.Object> arguments)
        Description copied from interface: ScriptEvaluator
        Evaluate the given script with the given arguments.
        Specified by:
        evaluate in interface ScriptEvaluator
        Parameters:
        script - the ScriptSource for the script to evaluate
        arguments - the key-value pairs to expose to the script, typically as script variables (may be null or empty)
        Returns:
        the return value of the script, if any