Annotation Type Help


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Help
    This annotation provides additional metadata for the help text beyond what would otherwise have been available with just the field level annotations.
    Author:
    John Dunlap
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String closingText
      The text to display after the list of options.
      int helpExitStatus
      The exit status which should be used when the help message is invoked.
      String[] helpTokens
      The tokens which should trigger the display of the help message.
      String name
      The name of the program.
      String openingText
      The text to display prior to the list of options.
      boolean showHelpOnError
      True if the help message should be displayed when an error occurs and false otherwise.
    • Element Detail

      • openingText

        String openingText
        The text to display prior to the list of options.
        Returns:
        The text to display prior to the list of options.
        Default:
        ""
      • closingText

        String closingText
        The text to display after the list of options.
        Returns:
        The text to display after the list of options.
        Default:
        ""
      • helpTokens

        String[] helpTokens
        The tokens which should trigger the display of the help message. Defaults to "-h" and "--help".
        Returns:
        The tokens which should trigger the display of the help message.
        Default:
        {"-h", "--help"}
      • showHelpOnError

        boolean showHelpOnError
        True if the help message should be displayed when an error occurs and false otherwise. Defaults to false.
        Returns:
        True if the help message should be displayed when an error occurs and false otherwise.
        Default:
        false
      • helpExitStatus

        int helpExitStatus
        The exit status which should be used when the help message is invoked. Defaults to 0.
        Returns:
        The exit status which should be used when the help message is invoked.
        Default:
        0
      • name

        String name
        The name of the program. Defaults to the name of the class.
        Returns:
        The name of the program.
        Default:
        ""