Interface ScriptEngineManager


  • @NonNullByDefault
    public interface ScriptEngineManager
    The ScriptEngineManager provides the ability to load and unload scripts.
    Author:
    Simon Merschjohann - Initial contribution, Scott Rushworth - changed parameter names when implementing ScriptModuleTypeProvider
    • Method Detail

      • createScriptEngine

        @Nullable ScriptEngineContainer createScriptEngine​(String scriptType,
                                                           String engineIdentifier)
        Creates a new ScriptEngine used to execute scripts, ScriptActions or ScriptConditions
        Parameters:
        scriptType - a file extension (script) or MimeType (ScriptAction or ScriptCondition)
        engineIdentifier - the unique identifier for the ScriptEngine (script file path or UUID)
        Returns:
        ScriptEngineContainer or null
      • loadScript

        void loadScript​(String engineIdentifier,
                        InputStreamReader scriptData)
        Loads a script and initializes its scope variables
        Parameters:
        engineIdentifier - the unique identifier for the ScriptEngine (script file path or UUID)
        scriptData - the content of the script
      • removeEngine

        void removeEngine​(String engineIdentifier)
        Unloads the ScriptEngine loaded with the engineIdentifier
        Parameters:
        engineIdentifier - the unique identifier for the ScriptEngine (script file path or UUID)
      • isSupported

        boolean isSupported​(String scriptType)
        Checks if the supplied file extension or MimeType is supported by the existing ScriptEngineFactories
        Parameters:
        scriptType - a file extension (script) or MimeType (ScriptAction or ScriptCondition)
        Returns:
        true, if supported, else false