java.lang.Object
org.springframework.shell.core.command.Script
All Implemented Interfaces:
Command

public class Script extends Object implements Command
A command that can read and execute other commands from a file.
Author:
Eric Bottard, Janne Valkealahti, Mahmoud Ben Hassine
  • Constructor Details

    • Script

      public Script()
  • Method Details

    • getDescription

      public String getDescription()
      Description copied from interface: Command
      Get a short description of the command.
      Specified by:
      getDescription in interface Command
      Returns:
      the description of the command
    • getGroup

      public String getGroup()
      Description copied from interface: Command
      Get the group of the command.
      Specified by:
      getGroup in interface Command
      Returns:
      the group of the command
    • execute

      public ExitStatus execute(CommandContext commandContext) throws Exception
      Description copied from interface: Command
      Execute the command within the given context.
      Specified by:
      execute in interface Command
      Parameters:
      commandContext - the context of the command
      Returns:
      the exit status of the command
      Throws:
      Exception
    • setCommandParser

      public void setCommandParser(CommandParser commandParser)
      Set the command parser to use to parse commands in the script.
      Parameters:
      commandParser - the command parser to set