Package org.springframework.shell.jline
Class NonInteractiveShellRunner
java.lang.Object
org.springframework.shell.jline.NonInteractiveShellRunner
- All Implemented Interfaces:
- ShellRunner
A 
ShellRunner that executes commands without entering interactive shell mode.
 Has higher precedence than InteractiveShellRunner which gives it an opportunity to handle the shell
 in non-interactive fashion.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intThe precedence at which this runner is ordered by the DefaultApplicationRunner - which also controls the order it is consulted on the ability to handle the current shell.
- 
Constructor SummaryConstructorsConstructorDescriptionNonInteractiveShellRunner(Shell shell, ShellContext shellContext) NonInteractiveShellRunner(Shell shell, ShellContext shellContext, String primaryCommand) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanExecuteShellRunnerwith given args.voidsetCommandsFromArgs(Function<String[], List<String>> commandsFromArgs) Sets the function that creates the command() to run from the input application arguments.voidsetLineParser(org.jline.reader.Parser lineParser) Sets the line parser used to parse commands.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.shell.ShellRunnercanRun, run
- 
Field Details- 
PRECEDENCEpublic static final int PRECEDENCEThe precedence at which this runner is ordered by the DefaultApplicationRunner - which also controls the order it is consulted on the ability to handle the current shell.- See Also:
 
 
- 
- 
Constructor Details- 
NonInteractiveShellRunner
- 
NonInteractiveShellRunner
 
- 
- 
Method Details- 
setCommandsFromArgsSets the function that creates the command() to run from the input application arguments.- Parameters:
- commandsFromArgs- function that takes input application arguments and creates zero or more commands where each command is a string that specifies the command and options (eg. 'history --file myHistory.txt')
 
- 
setLineParserpublic void setLineParser(org.jline.reader.Parser lineParser) Sets the line parser used to parse commands.- Parameters:
- lineParser- the line parser used to parse commands
 
- 
runDescription copied from interface:ShellRunnerExecuteShellRunnerwith given args. Return value indicates if run operation happened and no further runners should be used.- Specified by:
- runin interface- ShellRunner
- Parameters:
- args- the raw arguments
- Returns:
- true if run execution happened
- Throws:
- Exception- possible error during run
 
 
-