Module openj9.dtfj

Class BaseCommand

java.lang.Object
com.ibm.java.diagnostics.utils.commands.BaseCommand
All Implemented Interfaces:
ICommand
Direct Known Subclasses:
BaseJdmpviewCommand, PluginCommand, QuitCommand

public abstract class BaseCommand extends Object implements ICommand
Base command which supplies basic support.
  • Field Details

  • Constructor Details

    • BaseCommand

      protected BaseCommand()
  • Method Details

    • addCommand

      public CommandDescription addCommand(String name, String argDescription, String helpDescription)
      Parameters:
      name - Command Name
      argDescription - brief description of any optional or required arguments
      helpDescription - one-line description of the command argDescription should be a word describing the argument name, e.g: <address> to specify an address argument that is mandatory, or [address] to specify an address argument that is optional
    • addSubCommand

      public void addSubCommand(String cmdname, String subname, String argDescription, String help)
    • recognises

      public boolean recognises(String command, IContext context)
      Description copied from interface: ICommand
      Method used by an interactive engine to decide whether this command matches the command passed in by the user
      Specified by:
      recognises in interface ICommand
      Parameters:
      command - Command string entered by user. e.g. !j9x or info class
      context - Current context
      Returns:
      True if this command object can process the supplied command, commands should not assume that returning true will guarantee a subsequent invocation
    • getCommandDescriptions

      public Collection<String> getCommandDescriptions()
      Specified by:
      getCommandDescriptions in interface ICommand
      Returns:
      Strings to be inserted in help output
    • getCommandNames

      public Collection<String> getCommandNames()
      Specified by:
      getCommandNames in interface ICommand
      Returns:
      Strings containing command names
    • getConfig

      public PluginConfig getConfig()
      Description copied from interface: ICommand
      Identifies the configuration from which this command was created.
      Specified by:
      getConfig in interface ICommand
      Returns:
      configuration for this command
    • setConfig

      public void setConfig(PluginConfig config)