Class Command

    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean help
      Flag whether help should be printed for this command.
      static java.lang.String JAVACMD
      Common command line prefix.
      boolean quiet
      Flag whether output to stdout should be suppressed.
    • Constructor Summary

      Constructors 
      Constructor Description
      Command()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.String description()  
      abstract int execute​(java.io.PrintWriter out, java.io.PrintWriter err)
      Executes the given command.
      java.lang.String name()  
      protected void printHelp​(java.io.PrintWriter writer)
      Prints textual help for this command.
      java.lang.String usage​(CommandParser parser)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • JAVACMD

        public static final java.lang.String JAVACMD
        Common command line prefix.
        See Also:
        Constant Field Values
      • help

        public boolean help
        Flag whether help should be printed for this command.
      • quiet

        public boolean quiet
        Flag whether output to stdout should be suppressed.
    • Constructor Detail

      • Command

        public Command()
    • Method Detail

      • description

        public abstract java.lang.String description()
        Returns:
        Short description of the command.
      • name

        public java.lang.String name()
        Returns:
        name of the command
      • usage

        public java.lang.String usage​(CommandParser parser)
        Parameters:
        parser - parser for this command
        Returns:
        usage string displayed for help
      • execute

        public abstract int execute​(java.io.PrintWriter out,
                                    java.io.PrintWriter err)
                             throws java.lang.Exception
        Executes the given command.
        Parameters:
        out - std out
        err - std err
        Returns:
        exit code, should be 0 for normal operation
        Throws:
        java.lang.Exception - any exception that my occur during execution
      • printHelp

        protected void printHelp​(java.io.PrintWriter writer)
        Prints textual help for this command.
        Parameters:
        writer - output destination