Interface CLODelegate


public interface CLODelegate
Interface to process command line arguments
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    If settings for option are not known upon initialization, an up-to-date description is requested when needed (e.g.
    default int
    Optional: position of key in the list of arguments.
    default boolean
    parse(boolean isSet)
    Parse string arg and set configurable parameters that correspond to this command line option.
    default boolean
    Parse string arg and set configurable parameters that correspond to this command line option.
    default boolean
    parse(String arg, boolean isSet)
    Parse string arg and set configurable parameters that correspond to this command line option.
  • Method Details

    • parse

      default boolean parse(boolean isSet)
      Parse string arg and set configurable parameters that correspond to this command line option. The delegate for options with Argument.NONE must implement this method.

      Note: returning false triggers a warning about which command line option failed to correctly parse. If the parser can rectify the issue on the spot this is also acceptable. In that case the method should return true and possibly log the fact that parameters have been adjusted.

      Parameters:
      isSet - true if option was set on command line
      Returns:
      true if parsing successful
    • parse

      default boolean parse(String arg)
      Parse string arg and set configurable parameters that correspond to this command line option. The delegate for options with Argument.REQUIRED must implement this method.

      Note: returning false triggers a warning about which command line option failed to correctly parse. If the parser can rectify the issue on the spot this is also acceptable. In that case the method should return true and possibly log the fact that parameters have been adjusted.

      Parameters:
      arg - the argument for parsing by command line option
      Returns:
      true if parsing successful
    • parse

      default boolean parse(String arg, boolean isSet)
      Parse string arg and set configurable parameters that correspond to this command line option. The delegate for options with Argument.OPTIONAL must implement this method.

      Note: returning false triggers a warning about which command line option failed to correctly parse. If the parser can rectify the issue on the spot this is also acceptable. In that case the method should return true and possibly log the fact that parameters have been adjusted.

      Parameters:
      arg - the argument for parsing by command line option
      isSet - true if arg is set on commandline
      Returns:
      true if parsing successful
    • getDescription

      default String getDescription()
      If settings for option are not known upon initialization, an up-to-date description is requested when needed (e.g. if help is requested, typically using --help option).

      Note: the description string may contain any UTF-8 characters as well as HTML character entities. If necessary they will be escaped and converted to UTF-8 for display in XML documents.

      Returns:
      description of command line option.
    • getKeyPos

      default int getKeyPos()
      Optional: position of key in the list of arguments. Used in help display.
      Returns:
      the position of the key