Class AbstractScriptHelper

    • Field Detail

      • log

        protected final org.slf4j.Logger log
    • Constructor Detail

      • AbstractScriptHelper

        public AbstractScriptHelper()
    • Method Detail

      • setBindings

        public void setBindings​(Bindings bindings)
        Description copied from interface: ScriptHelper
        Set script bindings.
        Specified by:
        setBindings in interface ScriptHelper
        Parameters:
        bindings - new script bindings.
      • test

        public final boolean test​(String expr)
        Description copied from interface: ScriptHelper
        Evaluate a boolean expression.
        Specified by:
        test in interface ScriptHelper
        Parameters:
        expr - a boolean expression
        Returns:
        true or false
      • call

        public Object call​(Object obj,
                           String methodCall)
        Description copied from interface: ScriptHelper
        Call a method on the given object.

        The methodCall is a string expression containing arguments to be passed. For example:

         scriptHelper.call(bean, "test(var1, var2, var3)");
         
        This is a convenient method to call:
         scriptHelper.call(bean, "test", new Object[] { var1, var2, var3 });
         
        Specified by:
        call in interface ScriptHelper
        Parameters:
        obj - the object on which method should be called
        methodCall - method call expression
        Returns:
        return value of the method
      • eval

        public Object eval​(String expr)
        Description copied from interface: ScriptHelper
        Evaluate the given expression.
        Specified by:
        eval in interface ScriptHelper
        Parameters:
        expr - the expression to evaluate
        Returns:
        expression result