Class AbstractScriptEngineFactory

java.lang.Object
org.openhab.core.automation.module.script.AbstractScriptEngineFactory
All Implemented Interfaces:
ScriptEngineFactory

@NonNullByDefault public abstract class AbstractScriptEngineFactory extends Object implements ScriptEngineFactory
This is an abstract class for implementing ScriptEngineFactorys.
Author:
Scott Rushworth - Initial contribution
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
  • Constructor Details

    • AbstractScriptEngineFactory

      public AbstractScriptEngineFactory()
  • Method Details

    • getScriptTypes

      public List<String> getScriptTypes()
      Description copied from interface: ScriptEngineFactory
      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.
      Specified by:
      getScriptTypes in interface ScriptEngineFactory
      Returns:
      List of supported script types
    • scopeValues

      public void scopeValues(ScriptEngine scriptEngine, Map<String,Object> scopeValues)
      Description copied from interface: ScriptEngineFactory
      This method "scopes" new values into the given ScriptEngine.
      Specified by:
      scopeValues in interface ScriptEngineFactory
      Parameters:
      scriptEngine -
      scopeValues -
    • createScriptEngine

      public @Nullable ScriptEngine createScriptEngine(String scriptType)
      Description copied from interface: ScriptEngineFactory
      This method creates a new ScriptEngine based on the supplied file extension or MimeType.
      Specified by:
      createScriptEngine in interface ScriptEngineFactory
      Parameters:
      scriptType - a file extension (script) or MimeType (ScriptAction or ScriptCondition)
      Returns:
      ScriptEngine or null