Package org.jline.shell.impl
Class DefaultScriptRunner
- java.lang.Object
-
- org.jline.shell.impl.DefaultScriptRunner
-
- All Implemented Interfaces:
ScriptRunner
public class DefaultScriptRunner extends java.lang.Object implements ScriptRunner
Default implementation ofScriptRunnerthat reads a script file line by line and executes each line through the dispatcher.Features:
- Skips blank lines and lines starting with
#(comments) - Supports
\line continuation (backslash at end of line joins with the next line) - Each complete line is fed to
CommandDispatcher.execute(String)
- Since:
- 4.0
- See Also:
ScriptRunner
-
-
Constructor Summary
Constructors Constructor Description DefaultScriptRunner()Creates a new DefaultScriptRunner.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.nio.file.Path script, CommandSession session, CommandDispatcher dispatcher)Executes a script file.
-
-
-
Method Detail
-
execute
public void execute(java.nio.file.Path script, CommandSession session, CommandDispatcher dispatcher) throws java.lang.ExceptionDescription copied from interface:ScriptRunnerExecutes a script file.- Specified by:
executein interfaceScriptRunner- Parameters:
script- the path to the script filesession- the current command sessiondispatcher- the command dispatcher to execute lines through- Throws:
java.lang.Exception- if script execution fails
-
-