Interface OptionParser

  • All Known Implementing Classes:
    DefaultOptionParser

    public interface OptionParser
    A class that implements this OptionParser interface can parse a String array according to the Options specified and return a ParsedOptions.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      ParsedOptions parse​(Options options, java.lang.String[] args)
      Parse the arguments according to the specified options.
      ParsedOptions parse​(Options options, java.lang.String[] args, boolean skipParsingAtNonOption)
      Parse the arguments according to the specified options.
      ParsedOptions parse​(Options options, java.lang.String[] args, java.util.Properties properties)
      Parse the arguments according to the specified options and properties.
      ParsedOptions parse​(Options options, java.lang.String[] args, java.util.Properties properties, boolean skipParsingAtNonOption)
      Parse the arguments according to the specified options and properties.
    • Method Detail

      • parse

        ParsedOptions parse​(Options options,
                            java.lang.String[] args)
                     throws OptionParserException
        Parse the arguments according to the specified options.
        Parameters:
        options - the specified Options
        args - the command line arguments
        Returns:
        the list of atomic option and value tokens
        Throws:
        OptionParserException - if there are any problems encountered while parsing the command line tokens
      • parse

        ParsedOptions parse​(Options options,
                            java.lang.String[] args,
                            java.util.Properties properties)
                     throws OptionParserException
        Parse the arguments according to the specified options and properties.
        Parameters:
        options - the specified Options
        args - the command line arguments
        properties - command line option name-value pairs
        Returns:
        the list of atomic option and value tokens
        Throws:
        OptionParserException - if there are any problems encountered while parsing the command line tokens
      • parse

        ParsedOptions parse​(Options options,
                            java.lang.String[] args,
                            boolean skipParsingAtNonOption)
                     throws OptionParserException
        Parse the arguments according to the specified options.
        Parameters:
        options - the specified Options
        args - the command line arguments
        skipParsingAtNonOption - if true an unrecognized argument stops the parsing and the remaining arguments are added to the ParsedOptionss args list. If false an unrecognized argument triggers a ParseException.
        Returns:
        the list of atomic option and value tokens
        Throws:
        OptionParserException - if there are any problems encountered while parsing the command line tokens
      • parse

        ParsedOptions parse​(Options options,
                            java.lang.String[] args,
                            java.util.Properties properties,
                            boolean skipParsingAtNonOption)
                     throws OptionParserException
        Parse the arguments according to the specified options and properties.
        Parameters:
        options - the specified Options
        args - the command line arguments
        properties - command line option name-value pairs
        skipParsingAtNonOption - if true an unrecognized argument stops the parsing and the remaining arguments are added to the ParsedOptionss args list. If false an unrecognized argument triggers a ParseException.
        Returns:
        the list of atomic option and value tokens
        Throws:
        OptionParserException - if there are any problems encountered while parsing the command line tokens