Interface Script


  • public interface Script
    This interface is implemented by openHAB scripts.
    Author:
    Kai Kreuzer - Initial contribution
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object execute()
      Executes the script instance and returns the execution result
      Object execute​(org.eclipse.xtext.xbase.interpreter.IEvaluationContext evaluationContext)
      Executes the script instance with a given evaluation context and returns the execution result
    • Method Detail

      • execute

        Object execute()
                throws ScriptExecutionException
        Executes the script instance and returns the execution result
        Returns:
        the execution result or null, if the script does not have a return value
        Throws:
        ScriptExecutionException - if an error occurs during the execution
      • execute

        Object execute​(org.eclipse.xtext.xbase.interpreter.IEvaluationContext evaluationContext)
                throws ScriptExecutionException
        Executes the script instance with a given evaluation context and returns the execution result
        Parameters:
        evaluationContext - the evaluation context is a map of variables (name, object) that should be available during the script execution
        Returns:
        the execution result or null, if the script does not have a return value
        Throws:
        ScriptExecutionException - if an error occurs during the execution