Interface ArgsParser

All Superinterfaces:
ArgsParserMixin<ArgsParser>, ArgsSyntaxAccessor, ArgumentEscapeCodeAccessor, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ArgsParser>, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty, CliMetrics, org.refcodes.mixin.DescriptionAccessor, org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty, org.refcodes.mixin.EscapeCodesStatusAccessor, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty, LongOptionPrefixAccessor, LongOptionPrefixAccessor.LongOptionPrefixBuilder<ArgsParser>, LongOptionPrefixAccessor.LongOptionPrefixMutator, LongOptionPrefixAccessor.LongOptionPrefixProperty, org.refcodes.mixin.NameAccessor, org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty, Optionable, OptionEscapeCodeAccessor, OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ArgsParser>, OptionEscapeCodeAccessor.OptionEscapeCodeMutator, OptionEscapeCodeAccessor.OptionEscapeCodeProperty, org.refcodes.mixin.Resetable, org.refcodes.mixin.ResetEscapeCodeAccessor, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty, ShortOptionPrefixAccessor, ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ArgsParser>, ShortOptionPrefixAccessor.ShortOptionPrefixMutator, ShortOptionPrefixAccessor.ShortOptionPrefixProperty, SyntaxMetricsAccessor, SyntaxMetricsAccessor.SyntaxMetricsBuilder<ArgsParser>, SyntaxMetricsAccessor.SyntaxMetricsMutator, SyntaxMetricsAccessor.SyntaxMetricsProperty, org.refcodes.textual.TextBoxGridAccessor, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ArgsParser>, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty, org.refcodes.mixin.TitleAccessor, org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>, org.refcodes.mixin.TitleAccessor.TitleMutator, org.refcodes.mixin.TitleAccessor.TitleProperty
All Known Implementing Classes:
ArgsParserImpl

public interface ArgsParser extends Optionable, ArgsParserMixin<ArgsParser>, CliMetrics, org.refcodes.mixin.TitleAccessor.TitleProperty, org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>, org.refcodes.mixin.NameAccessor.NameProperty, org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty, org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>, org.refcodes.mixin.Resetable, ArgsSyntaxAccessor, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>, OptionEscapeCodeAccessor.OptionEscapeCodeProperty, OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ArgsParser>, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ArgsParser>, SyntaxMetricsAccessor.SyntaxMetricsProperty, SyntaxMetricsAccessor.SyntaxMetricsBuilder<ArgsParser>, ShortOptionPrefixAccessor.ShortOptionPrefixProperty, ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ArgsParser>, LongOptionPrefixAccessor.LongOptionPrefixProperty, LongOptionPrefixAccessor.LongOptionPrefixBuilder<ArgsParser>, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ArgsParser>
The ArgsParser provides means for parsing command line arguments and constructing a command line utility's help output.
  • Method Details

    • addExample

      void addExample(Example aExample)
      Adds a usage example by providing a description of the example and the command line arguments required by the example.
      Parameters:
      aExample - The description as well as the command line arguments used by the example.
    • addExample

      default void addExample(String aDescription, Operand<?>... aOperands)
      Adds a usage example by providing a description of the example and the command line arguments required by the example.
      Parameters:
      aDescription - The description of the example.
      aOperands - The command line arguments used by the example.
    • errorLn

      void errorLn(String aLine)
      Prints the given line to standard error with regards to the console width as specified by the withConsoleWidth(int) method.
      Parameters:
      aLine - The line to be printed.
    • evalArgs

      default List<? extends Operand<?>> evalArgs(List<String> aArgs) throws ArgsSyntaxException
      Same as evalArgs(String[]) with the difference that the elements representing the arguments are passed as a list instead of an array.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      Returns:
      The list of evaluated command line arguments being instances of the Operand interfaces or its sub-types.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • evalArgs

      default List<? extends Operand<?>> evalArgs(List<String> aArgs, ArgsFilter aArgsFilter) throws ArgsSyntaxException
      Evaluates the provided command line arguments, filtering (excluding) the arguments matching the provided ArgsFilter.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      aArgsFilter - The ArgsFilter used to filter (exclude) any "unwanted" or otherwise evaluated arguments.
      Returns:
      This instance as of the builder pattern to chain further method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • evalArgs

      default List<? extends Operand<?>> evalArgs(List<String> aArgs, Pattern aFilterExp) throws ArgsSyntaxException
      Evaluates the provided command line arguments, filtering (excluding) the arguments matching the provided Pattern.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      aFilterExp - The Pattern used to filter (exclude) any "unwanted" or otherwise evaluated arguments.
      Returns:
      This instance as of the builder pattern to chain further method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • evalArgs

      List<? extends Operand<?>> evalArgs(String[] aArgs) throws ArgsSyntaxException
      Evaluates the provided command line arguments and determines the according values by evaluating the root Condition. In case of parsing failure, an according exception is thrown. ATTENTION: This method tests(!) for superfluous command line arguments being passed; e.g. command line arguments not being evaluated by any of the Constituent instance being traversed starting at the root Condition will be reported. Business logic therefore should invoke this root node's evalArgs(String[]) method instead of a Condition's Constituent.parseArgs(String[], String[], CliContext) method; as ignoring superfluous command line arguments will cause unexpected behavior from the point of view of the invoker.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      Returns:
      The list of evaluated command line arguments being instances of the Operand interfaces or its sub-types.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • evalArgs

      default List<? extends Operand<?>> evalArgs(String[] aArgs, ArgsFilter aArgsFilter) throws ArgsSyntaxException
      Evaluates the provided command line arguments, filtering (excluding) the arguments matching the provided ArgsFilter.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      aArgsFilter - The ArgsFilter used to filter (exclude) any "unwanted" or otherwise evaluated arguments.
      Returns:
      This instance as of the builder pattern to chain further method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • evalArgs

      default List<? extends Operand<?>> evalArgs(String[] aArgs, Pattern aFilterExp) throws ArgsSyntaxException
      Evaluates the provided command line arguments, filtering (excluding) the arguments matching the provided Pattern.
      Parameters:
      aArgs - The command line arguments to be evaluated.
      aFilterExp - The Pattern used to filter (exclude) any "unwanted" or otherwise evaluated arguments.
      Returns:
      This instance as of the builder pattern to chain further method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • getArgsSyntax

      Constituent getArgsSyntax()
      The root condition is the starting point node of a Constituent hierarchy to be traversed when determining the syntax for command line arguments or when evaluating the command line arguments. Retrieves the root condition from the root condition property.
      Specified by:
      getArgsSyntax in interface ArgsSyntaxAccessor
      Returns:
      The root Condition in which's syntax this parser is based.
    • getBannerBorderEscapeCode

      String getBannerBorderEscapeCode()
      Retrieves the banner's border Escape-Code from the banner border Escape-Code property.
      Returns:
      The banner border Escape-Code stored by the banner border Escape-Code property.
    • getBannerEscapeCode

      String getBannerEscapeCode()
      Retrieves the banner's content Escape-Code from the banner Escape-Code property.
      Returns:
      The banner Escape-Code stored by the banner Escape-Code property.
    • getCommandEscapeCode

      String getCommandEscapeCode()
      Retrieves the command name's (CLI executable) Escape-Code from the command name Escape-Code property.
      Returns:
      The command name's Escape-Code stored by the command name Escape-Code property.
    • getCopyrightNote

      String getCopyrightNote()
      Retrieves the copyright.
      Returns:
      The copyright note.
    • getDescription

      String getDescription()
      Retrieves the description.
      Specified by:
      getDescription in interface org.refcodes.mixin.DescriptionAccessor
      Returns:
      The description.
    • getDescriptionEscapeCode

      String getDescriptionEscapeCode()
      Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.
      Returns:
      The description Escape-Code stored by the description Escape-Code property.
    • getExamples

      List<Example> getExamples()
      Retrieves the Example instances as added using addExample(String, Operand...).
      Returns:
      The according Example elements.
    • getLicenseNote

      String getLicenseNote()
      Retrieves the license.
      Returns:
      The license note.
    • getLineSeparatorEscapeCode

      String getLineSeparatorEscapeCode()
      Retrieves the line separator Escape-Code from the line separator Escape-Code property.
      Returns:
      The line separator Escape-Code stored by the line separator Escape-Code property.
    • getOptionEscapeCode

      String getOptionEscapeCode()
      Retrieves the option Escape-Code from the option Escape-Code property.
      Specified by:
      getOptionEscapeCode in interface OptionEscapeCodeAccessor
      Returns:
      The option Escape-Code stored by the option Escape-Code property.
    • getArgumentEscapeCode

      String getArgumentEscapeCode()
      Retrieves the parameter Escape-Code from the parameter Escape-Code property.
      Specified by:
      getArgumentEscapeCode in interface ArgumentEscapeCodeAccessor
      Returns:
      The parameter Escape-Code stored by the parameter Escape-Code property.
    • getSeparatorLnChar

      char getSeparatorLnChar()
      Gets the character to be used when printing a separator line with the printSeparatorLn() method.
      Returns:
      aSeparatorChar The character used by the printSeparatorLn() method when printing out the line of characters..
    • printBanner

      void printBanner()
      Prints the banner; the banner most probably is an ASCII_HEADER_ASCII_BODY art text block which's look depends strongly on the taste of the author implementing this interface.
    • printBody

      default void printBody()
      Prints the help as of printHelp() without the banner.
    • printCopyrightNote

      void printCopyrightNote()
      Prints the copyright note as specified by the withCopyrightNote(String) method; with regards to the console width as specified by the withConsoleWidth(int) method.
    • printDescription

      void printDescription()
      Prints the description as set by the withDescription(String) method with regards to the console width as specified by the withConsoleWidth(int) method.
    • printExamples

      void printExamples()
      Prints example usages as as added by the addExample(String, Operand...) method with regards to the console width as specified by the withConsoleWidth(int) method.
    • printHeader

      void printHeader()
      Prints the header, which might be a simplified banner: Can be used when overriding methods such as printHelp() or printBanner().
    • printHelp

      default void printHelp()
      Prints the help to the standard output specified by the withStandardOut(PrintStream) method. This method can make use of the more atomic methods printBanner(), printSynopsis(), printDescription(), printOptions() or printSeparatorLn() to print a help text which's look depends strongly on the taste of the author implementing this interface. In case you dislike the implementing author's taste, feel free to overwrite this method and compose your own help text from the building blocks such as printBanner(), printSynopsis(), printDescription(), printOptions() or printSeparatorLn()
    • printLicenseNote

      void printLicenseNote()
      Prints the license note as specified by the withLicenseNote(String) method; with regards to the console width as specified by the withConsoleWidth(int) method.
    • printLn

      void printLn()
      Prints an empty line / a line break.
    • printLn

      void printLn(String aLine)
      Prints the given line to standard out with regards to the console width as specified by the withConsoleWidth(int) method.
      Parameters:
      aLine - The line to be printed.
    • printOptions

      void printOptions()
      Prints the Options (short- and the long-options), the Flages and the Operand and their description with regards to the console width as specified by the withConsoleWidth(int) method.
    • printSeparatorLn

      void printSeparatorLn()
      Prints a separator line using the separator character as specified by the withSeparatorLnChar(char) method; with regards to the console width as specified by the withConsoleWidth(int) method.
    • printSynopsis

      void printSynopsis()
      Prints the syntax as retrieved by the root Condition element as of Synopsisable.toSynopsis(SyntaxNotation) with regards to the SyntaxNotation set by the withSyntaxMetrics(SyntaxMetrics) method.
    • setBannerBorderEscapeCode

      void setBannerBorderEscapeCode(String aBannerBorderEscCode)
      Sets the banner's border Escape-Code for the banner border Escape-Code property.
      Parameters:
      aBannerBorderEscCode - The banner border Escape-Code to be stored by the banner border Escape-Code property.
    • setBannerEscapeCode

      void setBannerEscapeCode(String aBannerEscCode)
      Sets the banner's content Escape-Code for the banner Escape-Code property.
      Parameters:
      aBannerEscCode - The banner Escape-Code to be stored by the banner Escape-Code property.
    • setBannerFont

      void setBannerFont(org.refcodes.textual.Font aBannerFont)
      Sets the banner font.
      Parameters:
      aBannerFont - the new banner font
    • setBannerFontPalette

      void setBannerFontPalette(char[] aColorPalette)
      Sets the banner font palette.
      Parameters:
      aColorPalette - the new banner font palette
    • setCommandEscapeCode

      void setCommandEscapeCode(String aCommandEscCode)
      Sets the command name's (CLI executable) Escape-Code for the command name Escape-Code property.
      Parameters:
      aCommandEscCode - The command name's Escape-Code to stored by the command name Escape-Code property.
    • setConsoleWidth

      void setConsoleWidth(int aConsoleWidth)
      Set the console with. A setting of "-1" makes the instance use the SystemUtility.getTerminalWidth() value, i.e. the console width is set automatically to be the width of your terminal.
      Parameters:
      aConsoleWidth - The width to set or -1 to let the parser automatically determine the console width.
    • setCopyrightNote

      void setCopyrightNote(String aCopyrightNote)
      Set the copyright note used by the printHelp() method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aCopyrightNote - The license note printed out by the printHelp() method.
    • setDescriptionEscapeCode

      void setDescriptionEscapeCode(String aDescriptionEscCode)
      Sets the description Escape-Code for the description Escape-Code property.
      Parameters:
      aDescriptionEscCode - The description Escape-Code to be stored by the description Escape-Code property.
    • setErrorOut

      void setErrorOut(PrintStream aErrorOut)
      Set the error out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aErrorOut - The error out PrintStream to set.
    • setLicenseNote

      void setLicenseNote(String aLicenseNote)
      Set the license note used by the printHelp() method when writing out the licensing conditions.
      Parameters:
      aLicenseNote - The license note printed out by the printHelp() method.
    • setLineBreak

      void setLineBreak(String aLineBreak)
      Set the console's line break. A setting of null makes the instance use the SystemUtility.getLineBreak() value.
      Parameters:
      aLineBreak - the new line break
    • setLineSeparatorEscapeCode

      void setLineSeparatorEscapeCode(String aLineSeparatorEscCode)
      Sets the line separator Escape-Code for the line separator Escape-Code property.
      Parameters:
      aLineSeparatorEscCode - The line separator Escape-Code to be stored by the line separator Escape-Code property.
    • setMaxConsoleWidth

      void setMaxConsoleWidth(int aMaxConsoleWidth)
      Set the maximum console width to use in case the console width is greater than the maximum you want. This is most useful when the console width is determined automatically to be the width of your terminal.
      Parameters:
      aMaxConsoleWidth - the new max console width
    • setOptionEscapeCode

      void setOptionEscapeCode(String aOptEscCode)
      Sets the option Escape-Code for the option Escape-Code property.
      Specified by:
      setOptionEscapeCode in interface OptionEscapeCodeAccessor.OptionEscapeCodeMutator
      Parameters:
      aOptEscCode - The option Escape-Code to be stored by the option Escape-Code property.
    • setArgumentEscapeCode

      void setArgumentEscapeCode(String aParamEscCode)
      Sets the parameter Escape-Code for the parameter Escape-Code property.
      Specified by:
      setArgumentEscapeCode in interface ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator
      Parameters:
      aParamEscCode - The parameter Escape-Code to be stored by the parameter Escape-Code property.
    • setSeparatorLnChar

      void setSeparatorLnChar(char aSeparatorLnChar)
      Set the character to be used when printing a separator line with the printSeparatorLn() method.
      Parameters:
      aSeparatorLnChar - The character used by the printSeparatorLn() method when printing out the line of characters..
    • setStandardOut

      void setStandardOut(PrintStream aStandardOut)
      Set the standard out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aStandardOut - The standard out PrintStream to set.
    • setSyntaxMetrics

      void setSyntaxMetrics(SyntaxMetrics aSyntaxMetrics)
      Specified by:
      setSyntaxMetrics in interface SyntaxMetricsAccessor.SyntaxMetricsMutator
      Parameters:
      aSyntaxMetrics - The SyntaxNotation to set.
    • toOptions

      default String[] toOptions(Option<?> aOption)
      Retrieves an array of the context specific options being configured for the given Option instance, being the long option (when set) and the short option (when set), by prepending the according runtime specific short option and long option prefix (if applicable).
      Specified by:
      toOptions in interface Optionable
      Parameters:
      aOption - The Option instance for which to get the configured short and long options.
      Returns:
      The array of options being the long option (if not null) and the short option (if not null) with the according context specific prefixes.
    • withBannerBorderEscapeCode

      default ArgsParser withBannerBorderEscapeCode(String aBannerBorderEscCode)
      Sets the banner's border Escape-Code for the banner border Escape-Code property.
      Parameters:
      aBannerBorderEscCode - The banner border Escape-Code to be stored by the banner border Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withBannerEscapeCode

      default ArgsParser withBannerEscapeCode(String aBannerEscCode)
      Sets the banner's content Escape-Code for the banner Escape-Code property.
      Parameters:
      aBannerEscCode - The banner Escape-Code to be stored by the banner Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withBannerFont

      default ArgsParser withBannerFont(org.refcodes.textual.Font aBannerFont)
      With banner font.
      Parameters:
      aBannerFont - the banner font
      Returns:
      the args parser
    • withBannerFontPalette

      default ArgsParser withBannerFontPalette(char[] aColorPalette)
      With banner font palette.
      Parameters:
      aColorPalette - the color palette
      Returns:
      the args parser
    • withCommandEscapeCode

      default ArgsParser withCommandEscapeCode(String aCommandEscCode)
      Sets the command name's (CLI executable) Escape-Code for the command name Escape-Code property.
      Parameters:
      aCommandEscCode - The command name's Escape-Code to stored by the command name Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withConsoleWidth

      default ArgsParser withConsoleWidth(int aConsoleWidth)
      Set the console with. A setting of "-1" makes the instance use the SystemUtility.getTerminalWidth() value.
      Parameters:
      aConsoleWidth - The width to set.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withCopyrightNote

      default ArgsParser withCopyrightNote(String aCopyrightNote)
      Set the copyright note used by the printHelp() method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aCopyrightNote - The license note printed out by the printHelp() method.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withDescription

      default ArgsParser withDescription(String aDescription)
      With description.
      Specified by:
      withDescription in interface org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>
      Parameters:
      aDescription - the description
      Returns:
      the args parser
    • withDescriptionEscapeCode

      default ArgsParser withDescriptionEscapeCode(String aDescriptionEscCode)
      Sets the description Escape-Code for the description Escape-Code property.
      Parameters:
      aDescriptionEscCode - The parameter's description Escape-Code to be stored by the parameter's description Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withErrorOut

      default ArgsParser withErrorOut(PrintStream aErrorOut)
      Set the error out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aErrorOut - The error out PrintStream to set.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withEscapeCodesEnabled

      default ArgsParser withEscapeCodesEnabled(boolean isEscCodeEnabled)
      Specified by:
      withEscapeCodesEnabled in interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>
    • withEvalArgs

      default ArgsParser withEvalArgs(List<String> aArgs) throws ArgsSyntaxException
      Same as evalArgs(List) with the difference that this class's instance being invoked is returned as of the builder pattern.
      Specified by:
      withEvalArgs in interface ArgsParserMixin<ArgsParser>
      Parameters:
      aArgs - The command line arguments to be evaluated.
      Returns:
      This invoked instance as of the builder pattern to chain method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • withEvalArgs

      default ArgsParser withEvalArgs(String[] aArgs) throws ArgsSyntaxException
      Same as evalArgs(String[]) with the difference that this class's instance being invoked is returned as of the builder pattern.
      Specified by:
      withEvalArgs in interface ArgsParserMixin<ArgsParser>
      Parameters:
      aArgs - The command line arguments to be evaluated.
      Returns:
      This invoked instance as of the builder pattern to chain method calls.
      Throws:
      ArgsSyntaxException - thrown in case of a command line arguments mismatch regarding provided and expected args.
    • withExample

      default ArgsParser withExample(Example aExample)
      Adds a usage example.
      Parameters:
      aExample - The Example to add.
      Returns:
      This instance as of the builder pattern.
    • withExample

      default ArgsParser withExample(String aDescription, Operand<?>... aOperands)
      Adds a usage example by providing a description of the example and the command line arguments required by the example.
      Parameters:
      aDescription - The description of the example.
      aOperands - The command line arguments used by the example.
      Returns:
      This instance as of the builder pattern.
    • withExamples

      default ArgsParser withExamples(Collection<Example> aExamples)
      Adds all the bunch of Example elements provided.
      Parameters:
      aExamples - The example usages to be added.
      Returns:
      This instance as of the builder pattern.
    • withExamples

      default ArgsParser withExamples(Example[] aExamples)
      Adds all the bunch of Example elements provided.
      Parameters:
      aExamples - The example usages to be added.
      Returns:
      This instance as of the builder pattern.
    • withLicenseNote

      default ArgsParser withLicenseNote(String aLicenseNote)
      Set the license note used by the printHelp() method when writing out the licensing conditions and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aLicenseNote - The license note printed out by the printHelp() method.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withLineBreak

      default ArgsParser withLineBreak(String aLineBreak)
      Set the console's line break. A setting of null makes the instance use the SystemUtility.getLineBreak() value.
      Parameters:
      aLineBreak - the line break
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withLineSeparatorEscapeCode

      default ArgsParser withLineSeparatorEscapeCode(String aLineSeparatorEscCode)
      Sets the line separator Escape-Code for the line separator Escape-Code property.
      Parameters:
      aLineSeparatorEscCode - The line separator Escape-Code to be stored by the line separator Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withLongOptionPrefix

      default ArgsParser withLongOptionPrefix(String aLongOptionPrefix)
      Sets the long option prefix for the long option prefix property.
      Specified by:
      withLongOptionPrefix in interface LongOptionPrefixAccessor.LongOptionPrefixBuilder<ArgsParser>
      Parameters:
      aLongOptionPrefix - The long option prefix to be stored by the long option prefix property.
      Returns:
      The builder for applying multiple build operations.
    • withMaxConsoleWidth

      default ArgsParser withMaxConsoleWidth(int aMaxConsoleWidth)
      Set the maximum console width to use in case the console width is greater than the maximum you want. This is most useful when the console width is determined automatically to be the width of your terminal.
      Parameters:
      aMaxConsoleWidth - the max console width
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withName

      default ArgsParser withName(String aName)
      With name.
      Specified by:
      withName in interface org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>
      Parameters:
      aName - the name
      Returns:
      the args parser
    • withOptionEscapeCode

      default ArgsParser withOptionEscapeCode(String aOptEscCode)
      Sets the option Escape-Code for the option Escape-Code property.
      Specified by:
      withOptionEscapeCode in interface OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ArgsParser>
      Parameters:
      aOptEscCode - The option Escape-Code to be stored by the option Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withArgumentEscapeCode

      default ArgsParser withArgumentEscapeCode(String aParamEscCode)
      Sets the parameter Escape-Code for the parameter Escape-Code property.
      Specified by:
      withArgumentEscapeCode in interface ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ArgsParser>
      Parameters:
      aParamEscCode - The parameter Escape-Code to be stored by the parameter Escape-Code property.
      Returns:
      The builder for applying multiple build operations.
    • withResetEscapeCode

      default ArgsParser withResetEscapeCode(String aResetEscCode)
      Specified by:
      withResetEscapeCode in interface org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>
    • withSeparatorLnChar

      default ArgsParser withSeparatorLnChar(char aSeparatorLnChar)
      Set the character to be used when printing a separator line with the printSeparatorLn() method.
      Parameters:
      aSeparatorLnChar - The character used by the printSeparatorLn() method when printing out the line of characters..
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withShortOptionPrefix

      default ArgsParser withShortOptionPrefix(Character aShortOptionPrefix)
      Sets the short option prefix for the short option prefix property.
      Specified by:
      withShortOptionPrefix in interface ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ArgsParser>
      Parameters:
      aShortOptionPrefix - The short option prefix to be stored by the short option prefix property.
      Returns:
      The builder for applying multiple build operations.
    • withStandardOut

      default ArgsParser withStandardOut(PrintStream aStandardOut)
      Set the standard out PrintStream and make other adjustments with the result (with regards to the Builder-Pattern).
      Parameters:
      aStandardOut - The standard out PrintStream to set.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withSyntaxMetrics

      default ArgsParser withSyntaxMetrics(SyntaxMetrics aSyntaxMetrics)
      Set the SyntaxNotation and make other adjustments with the result (with regards to the Builder-Pattern).
      Specified by:
      withSyntaxMetrics in interface SyntaxMetricsAccessor.SyntaxMetricsBuilder<ArgsParser>
      Parameters:
      aSyntaxMetrics - The SyntaxNotation to set.
      Returns:
      This ArgsParser instance with regard to the builder pattern.
    • withTextBoxGrid

      default ArgsParser withTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid)
      Specified by:
      withTextBoxGrid in interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ArgsParser>
    • withTitle

      default ArgsParser withTitle(String aTitle)
      With title.
      Specified by:
      withTitle in interface org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>
      Parameters:
      aTitle - the title
      Returns:
      the args parser