Class GroovyHandler

    • Constructor Detail

      • GroovyHandler

        public GroovyHandler()
    • Method Detail

      • isPresent

        public boolean isPresent()
        Returns whether the handler can be used.
        Specified by:
        isPresent in class AbstractScriptingHandler
        Returns:
        true if available
      • loadScriptObject

        public Object[] loadScriptObject​(Class cls,
                                         PlaceholderFile scriptFile,
                                         String scriptOptions,
                                         Variables vars)
        Loads the scripts object and sets its options.
        Specified by:
        loadScriptObject in class AbstractScriptingHandler
        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 Object invoke​(Object o,
                             String methodName,
                             Class[] paramClasses,
                             Object[] paramValues)
        Executes the specified method on the current interpreter and returns the result, if any.
        Specified by:
        invoke in class AbstractScriptingHandler
        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)