Class ScriptShellRunner

java.lang.Object
org.springframework.shell.jline.ScriptShellRunner
All Implemented Interfaces:
ShellRunner

@Order(-100) public class ScriptShellRunner extends Object implements ShellRunner
A ShellRunner that looks for process arguments that start with @, which are then interpreted as references to script files to run and exit.

Has higher precedence than NonInteractiveShellRunner and InteractiveShellRunner which gives it top priority to run the shell if scripts are found.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The 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 Summary

    Constructors
    Constructor
    Description
    ScriptShellRunner(org.jline.reader.Parser parser, Shell shell)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    run(String[] args)
    Execute ShellRunner with given args.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.shell.ShellRunner

    canRun, run
  • Field Details

    • PRECEDENCE

      public static final int PRECEDENCE
      The 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

    • ScriptShellRunner

      public ScriptShellRunner(org.jline.reader.Parser parser, Shell shell)
  • Method Details

    • run

      public boolean run(String[] args) throws Exception
      Description copied from interface: ShellRunner
      Execute ShellRunner with given args. Return value indicates if run operation happened and no further runners should be used.
      Specified by:
      run in interface ShellRunner
      Parameters:
      args - the raw arguments
      Returns:
      true if run execution happened
      Throws:
      Exception - possible error during run