Class BaseStructureCommand

java.lang.Object
com.ibm.j9ddr.tools.ddrinteractive.BaseStructureCommand
All Implemented Interfaces:
ICommand
Direct Known Subclasses:
StructureCommand

public abstract class BaseStructureCommand extends Object implements ICommand
Base class for structure formatting commands
  • Constructor Details

    • BaseStructureCommand

      public BaseStructureCommand()
  • Method Details

    • recognises

      public final boolean recognises(String command, Context context)
      Description copied from interface: ICommand
      Method used by the DDR 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
      context - Current DDRInteractive context
      Returns:
      True if this command object can process the supplied command (in which case the DDR engine will then call run())
    • registerFieldFormatter

      protected void registerFieldFormatter(IFieldFormatter formatter)
      Inserts supplied field formatter at the head of the list.
      Parameters:
      formatter -
    • registerStructureFormatter

      protected void registerStructureFormatter(IStructureFormatter formatter)
      Inserts supplied structure formatter at the head of the list.
      Parameters:
      formatter -
    • registerDefaultStructureFormatter

      protected void registerDefaultStructureFormatter(IStructureFormatter formatter)
      Inserts supplied structure formatter at the end of the list.
      Parameters:
      formatter -
    • run

      public final void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException
      Description copied from interface: ICommand
      Executes the command
      Specified by:
      run in interface ICommand
      Parameters:
      command - Command string e.g. !j9x
      args - Arguments for command
      context - Context to work in
      out - PrintStream to write command output on
      Throws:
      DDRInteractiveCommandException - If there is any problem running the command (incorrect usage, CorruptData etc.)
    • getCommandDescriptions

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

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