Interface CustomScriptAccessor


  • public interface CustomScriptAccessor
    Accessor interface for invoking custom scripts
    • Method Detail

      • bind

        CustomScriptAccessor bind​(String name,
                                  Object value)
        Binds a variable to the script context. Ignores if the name is null (useful to avoid conditional tests)
      • run

        <T> T run​(Class<T> expectedType)
        Runs the default script function (only if the script function type is DefaultScriptFunction), converting the result to the given type.
      • run

        <T> T run​(Class<T> expectedType,
                  ScriptFunction function)
        Runs the given script function, converting the result to the given type. If the function is optional and is not defined, returns null
      • run

        Object run​(ScriptFunction function)
        Runs the given script function. If the function is optional and is not defined, returns null
      • runForList

        <T> List<T> runForList​(Class<T> elementType)
        Runs the default script function (only if the script function type is DefaultScriptFunction), handling the result as a list of the given element type.
      • runForList

        <T> List<T> runForList​(Class<T> elementType,
                               ScriptFunction function)
        Runs the given script function, handling the result as a list of the given element type.. If the function is optional and is not defined, returns null