Interface ScriptEngineFactory

  • All Known Implementing Classes:
    AbstractScriptEngineFactory

    @NonNullByDefault
    public interface ScriptEngineFactory
    This class is used by the ScriptEngineManager to load ScriptEngines. This is meant as a way to allow other OSGi bundles to provide custom script-languages with special needs, e.g. Nashorn, Jython, Groovy, etc.
    Author:
    Simon Merschjohann - Initial contribution, Scott Rushworth - added/changed methods and parameters when implementing ScriptModuleTypeProvider
    • Method Detail

      • getScriptTypes

        List<String> getScriptTypes()
        This method returns a list of file extensions and MimeTypes that are supported by the ScriptEngine, e.g. py, application/python, js, application/javascript, etc.
        Returns:
        List of supported script types
      • scopeValues

        void scopeValues​(ScriptEngine scriptEngine,
                         Map<String,​Object> scopeValues)
        This method "scopes" new values into the given ScriptEngine.
        Parameters:
        scriptEngine -
        scopeValues -
      • createScriptEngine

        @Nullable ScriptEngine createScriptEngine​(String scriptType)
        This method creates a new ScriptEngine based on the supplied file extension or MimeType.
        Parameters:
        scriptType - a file extension (script) or MimeType (ScriptAction or ScriptCondition)
        Returns:
        ScriptEngine or null