Interface ScriptRunner

All Known Implementing Classes:
DefaultScriptRunner
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ScriptRunner
Executes a script file line by line through a CommandDispatcher.

A ScriptRunner reads lines from a script file and feeds them to the dispatcher for execution. The exact behavior (comment handling, line continuation, error handling) is determined by the implementation.

Example:

 ScriptRunner runner = (script, session, dispatcher) -> {
     Files.readAllLines(script).forEach(line -> dispatcher.execute(line));
 };
 
Since:
4.0
See Also: