Class ConsoleCommand

java.lang.Object
org.eclipse.rdf4j.console.command.ConsoleCommand
All Implemented Interfaces:
Command, Help
Direct Known Subclasses:
Clear, Close, Connect, Convert, Create, Disconnect, Drop, Export, Federate, Load, Open, PrintHelp, PrintInfo, QueryEvaluator, SetParameters, Show, Verify

public abstract class ConsoleCommand extends Object implements Command, Help
Abstract command
Author:
Bart Hanssens
  • Field Details Link icon

    • LOGGER Link icon

      protected final org.slf4j.Logger LOGGER
  • Constructor Details Link icon

    • ConsoleCommand Link icon

      public ConsoleCommand(ConsoleIO consoleIO)
      Constructor
      Parameters:
      consoleIO -
    • ConsoleCommand Link icon

      public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state)
      Constructor
      Parameters:
      consoleIO -
      state -
    • ConsoleCommand Link icon

      public ConsoleCommand(ConsoleIO consoleIO, ConsoleState state, Map<String,ConsoleSetting> settings)
      Constructor
      Parameters:
      consoleIO - console IO
      state - console state
      settings - console settings
  • Method Details Link icon

    • getConsoleIO Link icon

      public ConsoleIO getConsoleIO()
      Get console IO
      Returns:
      console IO
    • getConsoleState Link icon

      public ConsoleState getConsoleState()
      Get console state
      Returns:
      console state
    • getConsoleSettings Link icon

      public Map<String,ConsoleSetting> getConsoleSettings()
      Get console settings map
      Returns:
      map of console settings
    • getHelpShort Link icon

      public String getHelpShort()
      Get short description, small enough to fit on one console row
      Specified by:
      getHelpShort in interface Help
      Returns:
      help string
    • getHelpLong Link icon

      public String getHelpLong()
      Get long description
      Specified by:
      getHelpLong in interface Help
      Returns:
      string, can be multiple lines
    • usesSettings Link icon

      public String[] usesSettings()
      Description copied from interface: Command
      Return the names of the settings used.
      Specified by:
      usesSettings in interface Command
      Returns:
      string array of settings
    • execute Link icon

      public void execute(String... parameters)
      Description copied from interface: Command
      Execute the given parameters.
      Specified by:
      execute in interface Command
      Parameters:
      parameters - parameters typed by user
    • write Link icon

      protected void write(String str)
      Write a string to the console
      Parameters:
      str - text
    • writeln Link icon

      protected void writeln(String str)
      Write a string + newline to the console
      Parameters:
      str - text
    • writeInfo Link icon

      protected void writeInfo(String str)
      Write a string + newline to the console and to the log at level INFO
      Parameters:
      str - text
    • writeError Link icon

      protected void writeError(String str)
      Write a string + newline to the console and to the log as an error
      Parameters:
      str - text
    • writeError Link icon

      protected void writeError(String str, Exception e)
      Write a string + message of exception + newline to the console and to the log as an error
      Parameters:
      str - text
      e - exception
    • writeUnopenedError Link icon

      protected void writeUnopenedError()
      Write repository not opened error
    • askProceed Link icon

      protected boolean askProceed(String str, boolean defVal)
      Ask user to proceed
      Parameters:
      str - question to ask
      defVal - default value
      Returns:
      true