Class AbstractScriptingHandler

    • Constructor Detail

      • AbstractScriptingHandler

        public AbstractScriptingHandler()
    • Method Detail

      • isPresent

        public abstract boolean isPresent()
        Returns whether the handler can be used.
        Returns:
        true if available
      • loadScriptObject

        public abstract Object[] loadScriptObject​(Class cls,
                                                  PlaceholderFile scriptFile,
                                                  String scriptOptions,
                                                  Variables vars)
        Loads the scripts object and sets its options.
        Parameters:
        cls - the class to instantiate
        scriptFile - the external file to load
        scriptOptions - the options to set
        vars - the variables to use for expanding
        Returns:
        element 0: error messsage (null if ok), element 1: script object
      • invoke

        public abstract Object invoke​(Object o,
                                      String methodName,
                                      Class[] paramClasses,
                                      Object[] paramValues)
        Executes the specified method on the current interpreter and returns the result, if any.
        Parameters:
        o - the object the method should be called from, e.g., an Interpreter
        methodName - the name of the method
        paramClasses - the classes of the parameters
        paramValues - the values of the parameters
        Returns:
        the return value of the method, if any (in that case null)