Interface ScriptEngineFactory

  • All Known Implementing Classes:

    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.
    Simon Merschjohann - Initial contribution, Scott Rushworth - added/changed methods and parameters when implementing ScriptModuleTypeProvider, Jonathan Gilbert - added context keys
    • 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.
        List of supported script types
      • scopeValues

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

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