java.lang.Object
org.refcodes.cli.ArgsParser
- All Implemented Interfaces:
ArgsParserBuilder<ParseArgs>
,ArgsProcessorBuilder<ParseArgs>
,ArgsSyntaxAccessor
,ArgsSyntaxAccessor.ArgsSyntaxBuilder<ParseArgs>
,ArgsSyntaxAccessor.ArgsSyntaxMutator
,ArgsSyntaxAccessor.ArgsSyntaxProperty
,ArgumentEscapeCodeAccessor
,ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ParseArgs>
,ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator
,ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty
,BannerBorderEscapeCodeAccessor
,BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeBuilder<ParseArgs>
,BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeMutator
,BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeProperty
,BannerEscapeCodeAccessor
,BannerEscapeCodeAccessor.BannerEscapeCodeBuilder<ParseArgs>
,BannerEscapeCodeAccessor.BannerEscapeCodeMutator
,BannerEscapeCodeAccessor.BannerEscapeCodeProperty
,BannerFontAccessor
,BannerFontAccessor.BannerFontBuilder<ParseArgs>
,BannerFontAccessor.BannerFontMutator
,BannerFontAccessor.BannerFontProperty
,BannerFontPaletteAccessor
,BannerFontPaletteAccessor.BannerFontPaletteBuilder<ParseArgs>
,BannerFontPaletteAccessor.BannerFontPaletteMutator
,BannerFontPaletteAccessor.BannerFontPaletteProperty
,CliMetrics
,CommandEscapeCodeAccessor
,CommandEscapeCodeAccessor.CommandEscapeCodeBuilder<ParseArgs>
,CommandEscapeCodeAccessor.CommandEscapeCodeMutator
,CommandEscapeCodeAccessor.CommandEscapeCodeProperty
,CopyrightAccessor
,CopyrightAccessor.CopyrightBuilder<ParseArgs>
,CopyrightAccessor.CopyrightMutator
,CopyrightAccessor.CopyrightProperty
,DescriptionEscapeCodeAccessor
,DescriptionEscapeCodeAccessor.DescriptionEscapeCodeBuilder<ParseArgs>
,DescriptionEscapeCodeAccessor.DescriptionEscapeCodeMutator
,DescriptionEscapeCodeAccessor.DescriptionEscapeCodeProperty
,ExamplesAccessor
,ExamplesAccessor.ExamplesBuilder<ParseArgs>
,ExamplesAccessor.ExamplesMutator
,ExamplesAccessor.ExamplesProperty
,LicenseAccessor
,LicenseAccessor.LicenseBuilder<ParseArgs>
,LicenseAccessor.LicenseMutator
,LicenseAccessor.LicenseProperty
,LineSeparatorEscapeCodeAccessor
,LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeBuilder<ParseArgs>
,LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeMutator
,LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeProperty
,LongOptionPrefixAccessor
,LongOptionPrefixAccessor.LongOptionPrefixBuilder<ParseArgs>
,LongOptionPrefixAccessor.LongOptionPrefixMutator
,LongOptionPrefixAccessor.LongOptionPrefixProperty
,Optionable
,OptionEscapeCodeAccessor
,OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ParseArgs>
,OptionEscapeCodeAccessor.OptionEscapeCodeMutator
,OptionEscapeCodeAccessor.OptionEscapeCodeProperty
,ParseArgs
,ShortOptionPrefixAccessor
,ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ParseArgs>
,ShortOptionPrefixAccessor.ShortOptionPrefixMutator
,ShortOptionPrefixAccessor.ShortOptionPrefixProperty
,SyntaxMetricsAccessor
,SyntaxMetricsAccessor.SyntaxMetricsBuilder<ParseArgs>
,SyntaxMetricsAccessor.SyntaxMetricsMutator
,SyntaxMetricsAccessor.SyntaxMetricsProperty
,org.refcodes.mixin.ConsoleWidthAccessor
,org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthBuilder<ParseArgs>
,org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthMutator
,org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthProperty
,org.refcodes.mixin.DescriptionAccessor
,org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ParseArgs>
,org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
,org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
,org.refcodes.mixin.EscapeCodesStatusAccessor
,org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ParseArgs>
,org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
,org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty
,org.refcodes.mixin.LineBreakAccessor
,org.refcodes.mixin.LineBreakAccessor.LineBreakBuilder<ParseArgs>
,org.refcodes.mixin.LineBreakAccessor.LineBreakMutator
,org.refcodes.mixin.LineBreakAccessor.LineBreakProperty
,org.refcodes.mixin.MaxConsoleWidthAccessor
,org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthBuilder<ParseArgs>
,org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthMutator
,org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthProperty
,org.refcodes.mixin.NameAccessor
,org.refcodes.mixin.NameAccessor.NameBuilder<ParseArgs>
,org.refcodes.mixin.NameAccessor.NameMutator
,org.refcodes.mixin.NameAccessor.NameProperty
,org.refcodes.mixin.Resetable
,org.refcodes.mixin.ResetEscapeCodeAccessor
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ParseArgs>
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
,org.refcodes.mixin.Schemable
,org.refcodes.mixin.TitleAccessor
,org.refcodes.mixin.TitleAccessor.TitleBuilder<ParseArgs>
,org.refcodes.mixin.TitleAccessor.TitleMutator
,org.refcodes.mixin.TitleAccessor.TitleProperty
,org.refcodes.textual.TextBoxGridAccessor
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ParseArgs>
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
A straightforward implementation of the
ParseArgs
interface. The
constructor only provides means to set the required attributes as the
attributes to be adjusted optionally are already sufficiently preconfigured.
For adjusting them, a flavor of the Builder-Pattern is provided with which
you can easily chain the configuration of this instance; as them methods
return the instance of this class being configured. This helps to prevent the
telescoping constructor anti-pattern.
The SyntaxNotation
is pre-set with the SyntaxNotation.LOGICAL
notation.
The console width id preconfigured with the console's width as determined by
the SystemUtility.getTerminalWidth()
.
The standard out PrintStream
is preconfigured with the
System.out
PrintStream
.
The newline characters to be used for line breaks is "\r\n" on Windows
machines and "\"n" on all other machines as of the
SystemUtility.getLineBreak()
.
- See Also:
-
- "http://en.wikipedia.org/wiki/Builder_pattern"
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.cli.ArgsSyntaxAccessor
ArgsSyntaxAccessor.ArgsSyntaxBuilder<B extends ArgsSyntaxAccessor.ArgsSyntaxBuilder<B>>, ArgsSyntaxAccessor.ArgsSyntaxMutator, ArgsSyntaxAccessor.ArgsSyntaxProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.ArgumentEscapeCodeAccessor
ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<B extends ArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<B>>, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator, ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.BannerBorderEscapeCodeAccessor
BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeBuilder<B extends BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeBuilder<B>>, BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeMutator, BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.BannerEscapeCodeAccessor
BannerEscapeCodeAccessor.BannerEscapeCodeBuilder<B extends BannerEscapeCodeAccessor.BannerEscapeCodeBuilder<B>>, BannerEscapeCodeAccessor.BannerEscapeCodeMutator, BannerEscapeCodeAccessor.BannerEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.BannerFontAccessor
BannerFontAccessor.BannerFontBuilder<B extends BannerFontAccessor.BannerFontBuilder<B>>, BannerFontAccessor.BannerFontMutator, BannerFontAccessor.BannerFontProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.BannerFontPaletteAccessor
BannerFontPaletteAccessor.BannerFontPaletteBuilder<B extends BannerFontPaletteAccessor.BannerFontPaletteBuilder<B>>, BannerFontPaletteAccessor.BannerFontPaletteMutator, BannerFontPaletteAccessor.BannerFontPaletteProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.CommandEscapeCodeAccessor
CommandEscapeCodeAccessor.CommandEscapeCodeBuilder<B extends CommandEscapeCodeAccessor.CommandEscapeCodeBuilder<B>>, CommandEscapeCodeAccessor.CommandEscapeCodeMutator, CommandEscapeCodeAccessor.CommandEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.ConsoleWidthAccessor
org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthBuilder<B extends org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthBuilder<B>>, org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthMutator, org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.CopyrightAccessor
CopyrightAccessor.CopyrightBuilder<B extends CopyrightAccessor.CopyrightBuilder<B>>, CopyrightAccessor.CopyrightMutator, CopyrightAccessor.CopyrightProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.DescriptionAccessor
org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B extends org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<B>>, org.refcodes.mixin.DescriptionAccessor.DescriptionMutator, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.DescriptionEscapeCodeAccessor
DescriptionEscapeCodeAccessor.DescriptionEscapeCodeBuilder<B extends DescriptionEscapeCodeAccessor.DescriptionEscapeCodeBuilder<B>>, DescriptionEscapeCodeAccessor.DescriptionEscapeCodeMutator, DescriptionEscapeCodeAccessor.DescriptionEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.EscapeCodesStatusAccessor
org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<B extends org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<B>>, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.ExamplesAccessor
ExamplesAccessor.ExamplesBuilder<B extends ExamplesAccessor.ExamplesBuilder<B>>, ExamplesAccessor.ExamplesMutator, ExamplesAccessor.ExamplesProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.LicenseAccessor
LicenseAccessor.LicenseBuilder<B extends LicenseAccessor.LicenseBuilder<B>>, LicenseAccessor.LicenseMutator, LicenseAccessor.LicenseProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.LineBreakAccessor
org.refcodes.mixin.LineBreakAccessor.LineBreakBuilder<B extends org.refcodes.mixin.LineBreakAccessor.LineBreakBuilder<B>>, org.refcodes.mixin.LineBreakAccessor.LineBreakMutator, org.refcodes.mixin.LineBreakAccessor.LineBreakProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.LineSeparatorEscapeCodeAccessor
LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeBuilder<B extends LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeBuilder<B>>, LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeMutator, LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.LongOptionPrefixAccessor
LongOptionPrefixAccessor.LongOptionPrefixBuilder<B extends LongOptionPrefixAccessor.LongOptionPrefixBuilder<B>>, LongOptionPrefixAccessor.LongOptionPrefixMutator, LongOptionPrefixAccessor.LongOptionPrefixProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.MaxConsoleWidthAccessor
org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthBuilder<B extends org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthBuilder<B>>, org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthMutator, org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.NameAccessor
org.refcodes.mixin.NameAccessor.NameBuilder<B extends org.refcodes.mixin.NameAccessor.NameBuilder<B>>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.OptionEscapeCodeAccessor
OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<B extends OptionEscapeCodeAccessor.OptionEscapeCodeBuilder<B>>, OptionEscapeCodeAccessor.OptionEscapeCodeMutator, OptionEscapeCodeAccessor.OptionEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.ResetEscapeCodeAccessor
org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<B extends org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<B>>, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.ShortOptionPrefixAccessor
ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<B extends ShortOptionPrefixAccessor.ShortOptionPrefixBuilder<B>>, ShortOptionPrefixAccessor.ShortOptionPrefixMutator, ShortOptionPrefixAccessor.ShortOptionPrefixProperty
Nested classes/interfaces inherited from interface org.refcodes.cli.SyntaxMetricsAccessor
SyntaxMetricsAccessor.SyntaxMetricsBuilder<B extends SyntaxMetricsAccessor.SyntaxMetricsBuilder<B>>, SyntaxMetricsAccessor.SyntaxMetricsMutator, SyntaxMetricsAccessor.SyntaxMetricsProperty
Nested classes/interfaces inherited from interface org.refcodes.textual.TextBoxGridAccessor
org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<B extends org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<?>>, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator, org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.TitleAccessor
org.refcodes.mixin.TitleAccessor.TitleBuilder<B extends org.refcodes.mixin.TitleAccessor.TitleBuilder<B>>, org.refcodes.mixin.TitleAccessor.TitleMutator, org.refcodes.mixin.TitleAccessor.TitleProperty
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs theParseArgs
instance without any restrictions to the parsed arguments.ArgsParser
(CliContext aCliCtx) Constructs theParseArgs
instance without any restrictions to the parsed arguments.ArgsParser
(Term aArgsSyntax) Constructs theParseArgs
instance with the given rootCondition
and the defaultSyntaxNotation.LOGICAL
.ArgsParser
(Term aArgsSyntax, CliContext aCliCtx) Constructs theParseArgs
instance with the given rootCondition
and the defaultSyntaxNotation.LOGICAL
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExample
(Example aExampleUsage) Adds a usage example by providing a description of the example and the command line arguments required by the example.void
Prints the given line to standard error with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.Evaluates the provided command line arguments and determines the according values by evaluating the rootCondition
.Retrieves the argument Escape-Code from the argument Escape-Code property.Retrieves the banner border Escape-Code from the banner border Escape-Code property.Retrieves the banner Escape-Code from the banner Escape-Code property.org.refcodes.textual.Font
Retrieves the bannerFont
from the bannerFont
property.char[]
Retrieves the banner font palette from the banner font palette property.Retrieves the command Escape-Code from the command Escape-Code property.int
Retrieves the copyright from the copyright property.protected char
The delimiter to be used for colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs).Retrieves the description Escape-Code from the description Escape-Code property.Example[]
Retrieves the license from the license property.Retrieves the line separator Escape-Code from the line separator Escape-Code property.Retrieves the long option prefix from the long option prefix property.int
getName()
Retrieves the option Escape-Code from the option Escape-Code property.char
Gets the character to be used when printing a separator line with theParseArgs.printSeparatorLn()
method.Retrieves the short option prefix from the short option prefix property.Retrieves theSyntaxMetrics
from theSyntaxMetrics
property.org.refcodes.textual.TextBoxGrid
getTitle()
boolean
void
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.void
Prints the copyright note as specified by theParseArgs.withCopyright(String)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints the description as set by theParseArgs.withDescription(String)
method with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints example usages as as added by theParseArgs.addExample(String, Operand...)
method with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints the header, which might be a simplified banner: Can be used when overriding methods such asParseArgs.printHelp()
orParseArgs.printBanner()
.void
Prints the license note as specified by theParseArgs.withLicense(String)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
printLn()
Prints an empty line / a line break.void
Prints the given line to standard out with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints theOption
s (short- and the long-options), theFlag
es and theOperand
and their description with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints a separator line using the separator character as specified by theParseArgs.withSeparatorLnChar(char)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.void
Prints the syntax as retrieved by the rootCondition
element as ofSynopsisable.toSynopsis(SyntaxNotation)
with regards to theSyntaxNotation
set by theParseArgs.withSyntaxMetrics(SyntaxMetrics)
method.void
reset()
void
setArgsSyntax
(Term aArgsSyntax) void
setArgumentEscapeCode
(String aParamEscapeCode) Sets the argument Escape-Code for the argument Escape-Code property.void
setBannerBorderEscapeCode
(String aBannerBorderEscapeCode) Sets the banner border Escape-Code for the banner border Escape-Code property.void
setBannerEscapeCode
(String aBannerEscapeCode) Sets the banner Escape-Code for the banner Escape-Code property.void
setBannerFont
(org.refcodes.textual.Font aBannerFont) Sets the bannerFont
for the bannerFont
property.void
setBannerFontPalette
(char[] aColorPalette) Sets the banner font palette for the banner font palette property.void
setBannerFontPalette
(org.refcodes.data.AsciiColorPalette aBannerFontPalette) Sets the banner font palette for the banner font palette property.void
setCommandEscapeCode
(String aCommandEscapeCode) Sets the command Escape-Code for the command Escape-Code property.void
setConsoleWidth
(int aConsoleWidth) void
setCopyright
(String aCopyrightNote) Sets the copyright for the copyright property.void
setDescription
(String aDescription) void
setDescriptionEscapeCode
(String aDescriptionEscapeCode) Sets the description Escape-Code for the description Escape-Code property.void
setErrorOut
(PrintStream aErrorOut) Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).void
setEscapeCodesEnabled
(boolean isEscapeCodesEnabled) void
setExamples
(Example[] aExamples) void
setLicense
(String aLicenseNote) Sets the license for the license property.void
setLineBreak
(String aLineBreak) void
setLineSeparatorEscapeCode
(String aLineSeparatorEscapeCode) Sets the line separator Escape-Code for the line separator Escape-Code property.void
setLongOptionPrefix
(String aLongOptionPrefix) Sets the long option prefix for the long option prefix property.void
setMaxConsoleWidth
(int aMaxConsoleWidth) void
void
setOptionEscapeCode
(String aOptEscapeCode) Sets the option Escape-Code for the option Escape-Code property.void
setResetEscapeCode
(String aResetEscapeCode) void
setSeparatorLnChar
(char aSeparatorLnChar) Set the character to be used when printing a separator line with theParseArgs.printSeparatorLn()
method.void
setShortOptionPrefix
(Character aShortOptionPrefix) Sets the short option prefix for the short option prefix property.void
setStandardOut
(PrintStream aStandardOut) Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).void
setSyntaxMetrics
(SyntaxMetrics aSyntaxMetrics) Sets theSyntaxMetrics
for theSyntaxMetrics
property.void
setTextBoxGrid
(org.refcodes.textual.TextBoxGrid aTextBoxGrid) void
withAddExample
(String aDescription, Operand<?>... aOperands) Builder method adding an application'sExample
element.withAddExample
(Example aExamples) Builder method adding an application'sExample
element.withArgsSyntax
(Term aArgsSyntax) withArgumentEscapeCode
(String aParamEscCode) Sets the argument Escape-Code for the argument Escape-Code property.withBannerBorderEscapeCode
(String aBannerBorderEscCode) Sets the banner border Escape-Code for the banner border Escape-Code property.withBannerEscapeCode
(String aBannerEscCode) Sets the banner Escape-Code for the banner Escape-Code property.withBannerFont
(org.refcodes.textual.Font aBannerFont) Sets the bannerFont
for the bannerFont
property.withBannerFontPalette
(char[] aColorPalette) Sets the banner font palette for the banner font palette property.withBannerFontPalette
(org.refcodes.data.AsciiColorPalette aBannerFontPalette) Sets the banner font palette for the banner font palette property.withCommandEscapeCode
(String aCommandEscCode) Sets the command Escape-Code for the command Escape-Code property.withConsoleWidth
(int aConsoleWidth) withCopyright
(String aCopyright) Sets the copyright for the copyright property.withDescription
(String aDescription) withDescriptionEscapeCode
(String aDescriptionEscCode) Sets the description Escape-Code for the description Escape-Code property.withErrorOut
(PrintStream aErrorOut) Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).withEscapeCodesEnabled
(boolean aIsEscCodeEnabled) withEvalArgs
(String[] aArgs) Evaluates the provided command line arguments.withEvalArgs
(String[] aArgs, Pattern aFilterExp) Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedPattern
.withEvalArgs
(String[] aArgs, ArgsFilter aArgsFilter) Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedArgsFilter
.withEvalArgs
(List<String> aArgs) Evaluates the provided command line arguments .withEvalArgs
(List<String> aArgs, Pattern aFilterExp) Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedPattern
.withEvalArgs
(List<String> aArgs, ArgsFilter aArgsFilter) Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedArgsFilter
.withExamples
(Collection<Example> aExamples) Builder method providing the application'sExample
elements.withExamples
(Example[] aExamples) withLicense
(String aLicense) Sets the license for the license property.withLineBreak
(String aLineBreak) withLineSeparatorEscapeCode
(String aLineSeparatorEscCode) Sets the line separator Escape-Code for the line separator Escape-Code property.withLongOptionPrefix
(String aLongOptionPrefix) Sets the long option prefix for the long option prefix property.withMaxConsoleWidth
(int aMaxConsoleWidth) withOptionEscapeCode
(String aOptEscCode) Sets the option Escape-Code for the option Escape-Code property.withResetEscapeCode
(String aResetEscCode) withSeparatorLnChar
(char aSeparatorLnChar) Builder method adding an separator line char.withShortOptionPrefix
(Character aShortOptionPrefix) Sets the short option prefix for the short option prefix property.withStandardOut
(PrintStream aStandardOut) Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).withSyntaxMetrics
(SyntaxMetrics aSyntaxMetrics) Sets theSyntaxMetrics
for theSyntaxMetrics
property.withSyntaxMetrics
(SyntaxNotation aSyntaxNotation) Sets theSyntaxNotation
for theSyntaxNotation
property.withTextBoxGrid
(org.refcodes.textual.TextBoxGrid aTextBoxGrid) withTextBoxGrid
(org.refcodes.textual.TextBoxStyle aTextBoxStyle) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.cli.ArgsSyntaxAccessor.ArgsSyntaxProperty
letArgsSyntax
Methods inherited from interface org.refcodes.cli.ArgumentEscapeCodeAccessor.ArgumentEscapeCodeProperty
letArgumentEscapeCode
Methods inherited from interface org.refcodes.cli.BannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeProperty
letBannerBorderEscapeCode
Methods inherited from interface org.refcodes.cli.BannerEscapeCodeAccessor.BannerEscapeCodeProperty
letBannerEscapeCode
Methods inherited from interface org.refcodes.cli.BannerFontAccessor.BannerFontProperty
letBannerFont
Methods inherited from interface org.refcodes.cli.BannerFontPaletteAccessor.BannerFontPaletteProperty
letBannerFontPalette
Methods inherited from interface org.refcodes.cli.CommandEscapeCodeAccessor.CommandEscapeCodeProperty
letCommandEscapeCode
Methods inherited from interface org.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthProperty
letConsoleWidth
Methods inherited from interface org.refcodes.cli.CopyrightAccessor.CopyrightProperty
letCopyright
Methods inherited from interface org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
letDescription
Methods inherited from interface org.refcodes.cli.DescriptionEscapeCodeAccessor.DescriptionEscapeCodeProperty
letDescriptionEscapeCode
Methods inherited from interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty
letEscapeCodesEnabled
Methods inherited from interface org.refcodes.cli.ExamplesAccessor.ExamplesMutator
setExamples
Methods inherited from interface org.refcodes.cli.ExamplesAccessor.ExamplesProperty
letExamples
Methods inherited from interface org.refcodes.cli.LicenseAccessor.LicenseProperty
letLicense
Methods inherited from interface org.refcodes.mixin.LineBreakAccessor.LineBreakProperty
letLineBreak
Methods inherited from interface org.refcodes.cli.LineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeProperty
letLineSeparatorEscapeCode
Methods inherited from interface org.refcodes.cli.LongOptionPrefixAccessor.LongOptionPrefixProperty
letLongOptionPrefix
Methods inherited from interface org.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthProperty
letMaxConsoleWidth
Methods inherited from interface org.refcodes.mixin.NameAccessor.NameProperty
letName
Methods inherited from interface org.refcodes.cli.OptionEscapeCodeAccessor.OptionEscapeCodeProperty
letOptionEscapeCode
Methods inherited from interface org.refcodes.cli.ParseArgs
addExample, evalArgs, evalArgs, evalArgs, evalArgs, evalArgs, printBody, printHelp, toOptions, toSchema
Methods inherited from interface org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
letResetEscapeCode
Methods inherited from interface org.refcodes.cli.ShortOptionPrefixAccessor.ShortOptionPrefixProperty
letShortOptionPrefix
Methods inherited from interface org.refcodes.cli.SyntaxMetricsAccessor.SyntaxMetricsMutator
setSyntaxMetrics
Methods inherited from interface org.refcodes.cli.SyntaxMetricsAccessor.SyntaxMetricsProperty
letSyntaxMetrics, letSyntaxMetrics
Methods inherited from interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
setTextBoxGrid
Methods inherited from interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
letTextBoxGrid, letTextBoxGrid
Methods inherited from interface org.refcodes.mixin.TitleAccessor.TitleProperty
letTitle
-
Field Details
-
_errStream
-
_stdStream
-
-
Constructor Details
-
ArgsParser
public ArgsParser()Constructs theParseArgs
instance without any restrictions to the parsed arguments. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured. -
ArgsParser
Constructs theParseArgs
instance without any restrictions to the parsed arguments. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.- Parameters:
aCliCtx
- TheCliContext
to be used for initializing.
-
ArgsParser
Constructs theParseArgs
instance with the given rootCondition
and the defaultSyntaxNotation.LOGICAL
. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.- Parameters:
aArgsSyntax
- The args syntax rootTerm
node being the node from which parsing the command line arguments starts.
-
ArgsParser
Constructs theParseArgs
instance with the given rootCondition
and the defaultSyntaxNotation.LOGICAL
. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently preconfigured. For adjusting them, a flavor of the Builder-Pattern is provided with which you can easily chain the configuration of this instance; as them methods return the instance of this class being configured.- Parameters:
aArgsSyntax
- The args syntax rootTerm
node being the node from which parsing the command line arguments starts.aCliCtx
- TheCliContext
to be used for initializing.
-
-
Method Details
-
addExample
Adds a usage example by providing a description of the example and the command line arguments required by the example.- Specified by:
addExample
in interfaceParseArgs
- Parameters:
aExampleUsage
- The description as well as the command line arguments used by the example.
-
errorLn
Prints the given line to standard error with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method. -
evalArgs
Evaluates the provided command line arguments and determines the according values by evaluating the rootCondition
. 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 theTerm
instance being traversed starting at the rootCondition
will be reported. Business logic therefore should invoke this root node'sParseArgs.evalArgs(String[])
method instead of aCondition
'sTerm.parseArgs(String[], String[], CliContext)
method; as ignoring superfluous command line arguments will aCause unexpected behavior from the point of view of the invoker.- Specified by:
evalArgs
in interfaceParseArgs
- 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. In case anOperand
implements theApprovable
interface or inherits from theAbstractOperand
type, then theOperand
is also approved by invokingApprovable.approve()
orAbstractOperand.approve()
(which may trigger a registered lambda expression). - Throws:
ArgsSyntaxException
- thrown in case of a command line arguments mismatch regarding provided and expected args.
-
getArgsSyntax
- Specified by:
getArgsSyntax
in interfaceArgsSyntaxAccessor
- Specified by:
getArgsSyntax
in interfaceParseArgs
- Returns:
- The (root)
Term
stored by the (root)Term
property.
-
getArgumentEscapeCode
Retrieves the argument Escape-Code from the argument Escape-Code property.- Specified by:
getArgumentEscapeCode
in interfaceArgumentEscapeCodeAccessor
- Specified by:
getArgumentEscapeCode
in interfaceParseArgs
- Returns:
- The argument Escape-Code stored by the argument Escape-Code property.
-
getBannerBorderEscapeCode
Retrieves the banner border Escape-Code from the banner border Escape-Code property.- Specified by:
getBannerBorderEscapeCode
in interfaceBannerBorderEscapeCodeAccessor
- Specified by:
getBannerBorderEscapeCode
in interfaceParseArgs
- Returns:
- The banner border Escape-Code stored by the banner border Escape-Code property.
-
getBannerEscapeCode
Retrieves the banner Escape-Code from the banner Escape-Code property.- Specified by:
getBannerEscapeCode
in interfaceBannerEscapeCodeAccessor
- Specified by:
getBannerEscapeCode
in interfaceParseArgs
- Returns:
- The banner Escape-Code stored by the banner Escape-Code property.
-
getBannerFont
public org.refcodes.textual.Font getBannerFont()Retrieves the bannerFont
from the bannerFont
property.- Specified by:
getBannerFont
in interfaceBannerFontAccessor
- Returns:
- The banner
Font
stored by the bannerFont
property.
-
getBannerFontPalette
public char[] getBannerFontPalette()Retrieves the banner font palette from the banner font palette property.- Specified by:
getBannerFontPalette
in interfaceBannerFontPaletteAccessor
- Returns:
- The banner font palette stored by the banner font palette property.
-
getCommandEscapeCode
Retrieves the command Escape-Code from the command Escape-Code property.- Specified by:
getCommandEscapeCode
in interfaceCommandEscapeCodeAccessor
- Specified by:
getCommandEscapeCode
in interfaceParseArgs
- Returns:
- The command Escape-Code stored by the command Escape-Code property.
-
getConsoleWidth
public int getConsoleWidth()- Specified by:
getConsoleWidth
in interfaceorg.refcodes.mixin.ConsoleWidthAccessor
-
getCopyright
Retrieves the copyright from the copyright property.- Specified by:
getCopyright
in interfaceCopyrightAccessor
- Specified by:
getCopyright
in interfaceParseArgs
- Returns:
- The copyright stored by the copyright property.
-
getDescription
- Specified by:
getDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor
- Specified by:
getDescription
in interfaceParseArgs
-
getDescriptionEscapeCode
Retrieves the description Escape-Code from the description Escape-Code property.- Specified by:
getDescriptionEscapeCode
in interfaceDescriptionEscapeCodeAccessor
- Specified by:
getDescriptionEscapeCode
in interfaceParseArgs
- Returns:
- The description Escape-Code stored by the description Escape-Code property.
-
getExamples
- Specified by:
getExamples
in interfaceExamplesAccessor
- Specified by:
getExamples
in interfaceParseArgs
- Returns:
- The
Example
instances stored by theExample
instances property.
-
getLicense
Retrieves the license from the license property.- Specified by:
getLicense
in interfaceLicenseAccessor
- Specified by:
getLicense
in interfaceParseArgs
- Returns:
- The license stored by the license property.
-
getLineBreak
- Specified by:
getLineBreak
in interfaceorg.refcodes.mixin.LineBreakAccessor
-
getLineSeparatorEscapeCode
Retrieves the line separator Escape-Code from the line separator Escape-Code property.- Specified by:
getLineSeparatorEscapeCode
in interfaceLineSeparatorEscapeCodeAccessor
- Specified by:
getLineSeparatorEscapeCode
in interfaceParseArgs
- Returns:
- The line separator Escape-Code stored by the line separator Escape-Code property.
-
getLongOptionPrefix
Retrieves the long option prefix from the long option prefix property.- Specified by:
getLongOptionPrefix
in interfaceLongOptionPrefixAccessor
- Returns:
- The long option prefix stored by the long option prefix property.
-
getMaxConsoleWidth
public int getMaxConsoleWidth()- Specified by:
getMaxConsoleWidth
in interfaceorg.refcodes.mixin.MaxConsoleWidthAccessor
-
getName
- Specified by:
getName
in interfaceorg.refcodes.mixin.NameAccessor
-
getOptionEscapeCode
Retrieves the option Escape-Code from the option Escape-Code property.- Specified by:
getOptionEscapeCode
in interfaceOptionEscapeCodeAccessor
- Specified by:
getOptionEscapeCode
in interfaceParseArgs
- Returns:
- The option Escape-Code stored by the option Escape-Code property.
-
getResetEscapeCode
- Specified by:
getResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor
-
getSeparatorLnChar
public char getSeparatorLnChar()Gets the character to be used when printing a separator line with theParseArgs.printSeparatorLn()
method.- Specified by:
getSeparatorLnChar
in interfaceParseArgs
- Returns:
- aSeparatorChar The character used by the
ParseArgs.printSeparatorLn()
method when printing out the line of characters..
-
getShortOptionPrefix
Retrieves the short option prefix from the short option prefix property.- Specified by:
getShortOptionPrefix
in interfaceShortOptionPrefixAccessor
- Returns:
- The short option prefix stored by the short option prefix property.
-
getSyntaxMetrics
Retrieves theSyntaxMetrics
from theSyntaxMetrics
property.- Specified by:
getSyntaxMetrics
in interfaceSyntaxMetricsAccessor
- Returns:
- The
SyntaxMetrics
stored by the decorator (enabled) tags property.
-
getTextBoxGrid
public org.refcodes.textual.TextBoxGrid getTextBoxGrid()- Specified by:
getTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor
-
getTitle
- Specified by:
getTitle
in interfaceorg.refcodes.mixin.TitleAccessor
-
isEscapeCodesEnabled
public boolean isEscapeCodesEnabled()- Specified by:
isEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor
-
printBanner
public 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.- Specified by:
printBanner
in interfaceParseArgs
-
printCopyright
public void printCopyright()Prints the copyright note as specified by theParseArgs.withCopyright(String)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printCopyright
in interfaceParseArgs
-
printDescription
public void printDescription()Prints the description as set by theParseArgs.withDescription(String)
method with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printDescription
in interfaceParseArgs
-
printExamples
public void printExamples()Prints example usages as as added by theParseArgs.addExample(String, Operand...)
method with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printExamples
in interfaceParseArgs
-
printHeader
public void printHeader()Prints the header, which might be a simplified banner: Can be used when overriding methods such asParseArgs.printHelp()
orParseArgs.printBanner()
.- Specified by:
printHeader
in interfaceParseArgs
-
printLicense
public void printLicense()Prints the license note as specified by theParseArgs.withLicense(String)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printLicense
in interfaceParseArgs
-
printLn
public void printLn()Prints an empty line / a line break. -
printLn
Prints the given line to standard out with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method. -
printOptions
public void printOptions()Prints theOption
s (short- and the long-options), theFlag
es and theOperand
and their description with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printOptions
in interfaceParseArgs
-
printSeparatorLn
public void printSeparatorLn()Prints a separator line using the separator character as specified by theParseArgs.withSeparatorLnChar(char)
method; with regards to the console width as specified by theParseArgs.withConsoleWidth(int)
method.- Specified by:
printSeparatorLn
in interfaceParseArgs
-
printSynopsis
public void printSynopsis()Prints the syntax as retrieved by the rootCondition
element as ofSynopsisable.toSynopsis(SyntaxNotation)
with regards to theSyntaxNotation
set by theParseArgs.withSyntaxMetrics(SyntaxMetrics)
method.- Specified by:
printSynopsis
in interfaceParseArgs
-
reset
public void reset()- Specified by:
reset
in interfaceorg.refcodes.mixin.Resetable
-
setArgsSyntax
- Specified by:
setArgsSyntax
in interfaceArgsSyntaxAccessor.ArgsSyntaxMutator
- Parameters:
aArgsSyntax
- The (root)Term
to be stored by the (root)Term
property.
-
setArgumentEscapeCode
Sets the argument Escape-Code for the argument Escape-Code property.- Specified by:
setArgumentEscapeCode
in interfaceArgumentEscapeCodeAccessor.ArgumentEscapeCodeMutator
- Parameters:
aParamEscapeCode
- The argument Escape-Code to be stored by the argument Escape-Code property.
-
setBannerBorderEscapeCode
Sets the banner border Escape-Code for the banner border Escape-Code property.- Specified by:
setBannerBorderEscapeCode
in interfaceBannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeMutator
- Parameters:
aBannerBorderEscapeCode
- The banner border Escape-Code to be stored by the banner border Escape-Code property.
-
setBannerEscapeCode
Sets the banner Escape-Code for the banner Escape-Code property.- Specified by:
setBannerEscapeCode
in interfaceBannerEscapeCodeAccessor.BannerEscapeCodeMutator
- Parameters:
aBannerEscapeCode
- The banner Escape-Code to be stored by the banner Escape-Code property.
-
setBannerFont
public void setBannerFont(org.refcodes.textual.Font aBannerFont) Sets the bannerFont
for the bannerFont
property.- Specified by:
setBannerFont
in interfaceBannerFontAccessor.BannerFontMutator
- Parameters:
aBannerFont
- The bannerFont
to be stored by the bannerFont
property.
-
setBannerFontPalette
public void setBannerFontPalette(org.refcodes.data.AsciiColorPalette aBannerFontPalette) Sets the banner font palette for the banner font palette property.- Specified by:
setBannerFontPalette
in interfaceBannerFontPaletteAccessor.BannerFontPaletteMutator
- Parameters:
aBannerFontPalette
- The banner font palette to be stored by the banner palette property.
-
setBannerFontPalette
public void setBannerFontPalette(char[] aColorPalette) Sets the banner font palette for the banner font palette property.- Specified by:
setBannerFontPalette
in interfaceBannerFontPaletteAccessor.BannerFontPaletteMutator
- Parameters:
aColorPalette
- The banner font palette to be stored by the banner palette property.
-
setCommandEscapeCode
Sets the command Escape-Code for the command Escape-Code property.- Specified by:
setCommandEscapeCode
in interfaceCommandEscapeCodeAccessor.CommandEscapeCodeMutator
- Parameters:
aCommandEscapeCode
- The command Escape-Code to be stored by the command Escape-Code property.
-
setConsoleWidth
public void setConsoleWidth(int aConsoleWidth) - Specified by:
setConsoleWidth
in interfaceorg.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthMutator
-
setCopyright
Sets the copyright for the copyright property.- Specified by:
setCopyright
in interfaceCopyrightAccessor.CopyrightMutator
- Parameters:
aCopyrightNote
- The copyright to be stored by the console width property.
-
setDescription
- Specified by:
setDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor.DescriptionMutator
-
setDescriptionEscapeCode
Sets the description Escape-Code for the description Escape-Code property.- Specified by:
setDescriptionEscapeCode
in interfaceDescriptionEscapeCodeAccessor.DescriptionEscapeCodeMutator
- Parameters:
aDescriptionEscapeCode
- The description Escape-Code to be stored by the description Escape-Code property.
-
setErrorOut
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setErrorOut
in interfaceParseArgs
- Parameters:
aErrorOut
- The error outPrintStream
to set.
-
setEscapeCodesEnabled
public void setEscapeCodesEnabled(boolean isEscapeCodesEnabled) - Specified by:
setEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
-
setExamples
- Specified by:
setExamples
in interfaceExamplesAccessor.ExamplesMutator
- Parameters:
aExamples
- TheExample
instances to be stored.
-
setLicense
Sets the license for the license property.- Specified by:
setLicense
in interfaceLicenseAccessor.LicenseMutator
- Parameters:
aLicenseNote
- The license to be stored by the console width property.
-
setLineBreak
- Specified by:
setLineBreak
in interfaceorg.refcodes.mixin.LineBreakAccessor.LineBreakMutator
-
setLineSeparatorEscapeCode
Sets the line separator Escape-Code for the line separator Escape-Code property.- Specified by:
setLineSeparatorEscapeCode
in interfaceLineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeMutator
- Specified by:
setLineSeparatorEscapeCode
in interfaceParseArgs
- Parameters:
aLineSeparatorEscapeCode
- The line separator Escape-Code to be stored by the line separator Escape-Code property.
-
setLongOptionPrefix
Sets the long option prefix for the long option prefix property.- Specified by:
setLongOptionPrefix
in interfaceLongOptionPrefixAccessor.LongOptionPrefixMutator
- Parameters:
aLongOptionPrefix
- The long option prefix to be stored by the long option prefix property.
-
setMaxConsoleWidth
public void setMaxConsoleWidth(int aMaxConsoleWidth) - Specified by:
setMaxConsoleWidth
in interfaceorg.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthMutator
-
setName
- Specified by:
setName
in interfaceorg.refcodes.mixin.NameAccessor.NameMutator
-
setOptionEscapeCode
Sets the option Escape-Code for the option Escape-Code property.- Specified by:
setOptionEscapeCode
in interfaceOptionEscapeCodeAccessor.OptionEscapeCodeMutator
- Parameters:
aOptEscapeCode
- The option Escape-Code to be stored by the option Escape-Code property.
-
setResetEscapeCode
- Specified by:
setResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
-
setSeparatorLnChar
public void setSeparatorLnChar(char aSeparatorLnChar) Set the character to be used when printing a separator line with theParseArgs.printSeparatorLn()
method.- Specified by:
setSeparatorLnChar
in interfaceParseArgs
- Parameters:
aSeparatorLnChar
- The character used by theParseArgs.printSeparatorLn()
method when printing out the line of characters..
-
setShortOptionPrefix
Sets the short option prefix for the short option prefix property.- Specified by:
setShortOptionPrefix
in interfaceShortOptionPrefixAccessor.ShortOptionPrefixMutator
- Parameters:
aShortOptionPrefix
- The short option prefix to be stored by the short option prefix property.
-
setStandardOut
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setStandardOut
in interfaceParseArgs
- Parameters:
aStandardOut
- The standard outPrintStream
to set.
-
setSyntaxMetrics
Sets theSyntaxMetrics
for theSyntaxMetrics
property.- Specified by:
setSyntaxMetrics
in interfaceParseArgs
- Specified by:
setSyntaxMetrics
in interfaceSyntaxMetricsAccessor.SyntaxMetricsMutator
- Parameters:
aSyntaxMetrics
- TheSyntaxMetrics
to be stored by theSyntaxMetrics
property.
-
setTextBoxGrid
public void setTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid) - Specified by:
setTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
-
setTitle
- Specified by:
setTitle
in interfaceorg.refcodes.mixin.TitleAccessor.TitleMutator
-
withAddExample
Builder method adding an application'sExample
element.- Specified by:
withAddExample
in interfaceArgsProcessorBuilder<ParseArgs>
- Specified by:
withAddExample
in interfaceParseArgs
- Parameters:
aExamples
- The application'sExample
element to be added.- Returns:
- This builder as of the builder pattern.
-
withAddExample
Builder method adding an application'sExample
element.- Specified by:
withAddExample
in interfaceArgsProcessorBuilder<ParseArgs>
- Specified by:
withAddExample
in interfaceParseArgs
- Parameters:
aDescription
- The example's description.aOperands
- The command line arguments required by the example.- Returns:
- This builder as of the builder pattern.
-
withArgsSyntax
- Specified by:
withArgsSyntax
in interfaceArgsSyntaxAccessor.ArgsSyntaxBuilder<ParseArgs>
- Parameters:
aArgsSyntax
- The (root)Term
to be stored by the (root)Term
property.- Returns:
- The builder for applying multiple build operations.
-
withArgumentEscapeCode
Sets the argument Escape-Code for the argument Escape-Code property.- Specified by:
withArgumentEscapeCode
in interfaceArgumentEscapeCodeAccessor.ArgumentEscapeCodeBuilder<ParseArgs>
- Specified by:
withArgumentEscapeCode
in interfaceParseArgs
- Parameters:
aParamEscCode
- The argument Escape-Code to be stored by the argument Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withBannerBorderEscapeCode
Sets the banner border Escape-Code for the banner border Escape-Code property.- Specified by:
withBannerBorderEscapeCode
in interfaceBannerBorderEscapeCodeAccessor.BannerBorderEscapeCodeBuilder<ParseArgs>
- Specified by:
withBannerBorderEscapeCode
in interfaceParseArgs
- 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
Sets the banner Escape-Code for the banner Escape-Code property.- Specified by:
withBannerEscapeCode
in interfaceBannerEscapeCodeAccessor.BannerEscapeCodeBuilder<ParseArgs>
- Specified by:
withBannerEscapeCode
in interfaceParseArgs
- Parameters:
aBannerEscCode
- The banner Escape-Code to be stored by the banner Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withBannerFont
Sets the bannerFont
for the bannerFont
property.- Specified by:
withBannerFont
in interfaceBannerFontAccessor.BannerFontBuilder<ParseArgs>
- Specified by:
withBannerFont
in interfaceParseArgs
- Parameters:
aBannerFont
- The bannerFont
to be stored by the bannerFont
property.- Returns:
- The builder for applying multiple build operations.
-
withBannerFontPalette
Sets the banner font palette for the banner font palette property.- Specified by:
withBannerFontPalette
in interfaceBannerFontPaletteAccessor.BannerFontPaletteBuilder<ParseArgs>
- Parameters:
aBannerFontPalette
- The banner font palette to be stored by the banner palette property.- Returns:
- The builder for applying multiple build operations.
-
withBannerFontPalette
Sets the banner font palette for the banner font palette property.- Specified by:
withBannerFontPalette
in interfaceBannerFontPaletteAccessor.BannerFontPaletteBuilder<ParseArgs>
- Specified by:
withBannerFontPalette
in interfaceParseArgs
- Parameters:
aColorPalette
- The banner font palette to be stored by the banner palette property.- Returns:
- The builder for applying multiple build operations.
-
withCommandEscapeCode
Sets the command Escape-Code for the command Escape-Code property.- Specified by:
withCommandEscapeCode
in interfaceCommandEscapeCodeAccessor.CommandEscapeCodeBuilder<ParseArgs>
- Specified by:
withCommandEscapeCode
in interfaceParseArgs
- Parameters:
aCommandEscCode
- The command Escape-Code to be stored by the command Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withConsoleWidth
- Specified by:
withConsoleWidth
in interfaceorg.refcodes.mixin.ConsoleWidthAccessor.ConsoleWidthBuilder<ParseArgs>
- Specified by:
withConsoleWidth
in interfaceParseArgs
-
withCopyright
Sets the copyright for the copyright property.- Specified by:
withCopyright
in interfaceCopyrightAccessor.CopyrightBuilder<ParseArgs>
- Specified by:
withCopyright
in interfaceParseArgs
- Parameters:
aCopyright
- The copyright to be stored by the console width property.- Returns:
- The builder for applying multiple build operations.
-
withDescription
- Specified by:
withDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ParseArgs>
- Specified by:
withDescription
in interfaceParseArgs
-
withDescriptionEscapeCode
Sets the description Escape-Code for the description Escape-Code property.- Specified by:
withDescriptionEscapeCode
in interfaceDescriptionEscapeCodeAccessor.DescriptionEscapeCodeBuilder<ParseArgs>
- Specified by:
withDescriptionEscapeCode
in interfaceParseArgs
- Parameters:
aDescriptionEscCode
- The description Escape-Code to be stored by the description Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withErrorOut
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
withErrorOut
in interfaceArgsProcessorBuilder<ParseArgs>
- Specified by:
withErrorOut
in interfaceParseArgs
- Parameters:
aErrorOut
- The error outPrintStream
to set.- Returns:
- This instance with regard to the builder pattern.
-
withEscapeCodesEnabled
- Specified by:
withEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ParseArgs>
- Specified by:
withEscapeCodesEnabled
in interfaceParseArgs
-
withEvalArgs
Evaluates the provided command line arguments .- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Specified by:
withEvalArgs
in interfaceParseArgs
- Parameters:
aArgs
- The command line arguments to be evaluated.- 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.
-
withEvalArgs
public ArgsParser withEvalArgs(List<String> aArgs, ArgsFilter aArgsFilter) throws ArgsSyntaxException Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedArgsFilter
.- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Parameters:
aArgs
- The command line arguments to be evaluated.aArgsFilter
- TheArgsFilter
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.
-
withEvalArgs
Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedPattern
.- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Parameters:
aArgs
- The command line arguments to be evaluated.aFilterExp
- ThePattern
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.
-
withEvalArgs
Evaluates the provided command line arguments.- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Specified by:
withEvalArgs
in interfaceParseArgs
- Parameters:
aArgs
- The command line arguments to be evaluated.- 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.
-
withEvalArgs
Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedArgsFilter
.- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Parameters:
aArgs
- The command line arguments to be evaluated.aArgsFilter
- TheArgsFilter
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.
-
withEvalArgs
Evaluates the provided command line arguments, filtering (excluding) the arguments matching the providedPattern
.- Specified by:
withEvalArgs
in interfaceArgsParserBuilder<ParseArgs>
- Parameters:
aArgs
- The command line arguments to be evaluated.aFilterExp
- ThePattern
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.
-
withExamples
Builder method providing the application'sExample
elements.- Specified by:
withExamples
in interfaceExamplesAccessor.ExamplesBuilder<ParseArgs>
- Specified by:
withExamples
in interfaceParseArgs
- Parameters:
aExamples
- The application'sExample
elements to use.- Returns:
- This builder as of the builder pattern.
-
withExamples
- Specified by:
withExamples
in interfaceExamplesAccessor.ExamplesBuilder<ParseArgs>
- Specified by:
withExamples
in interfaceParseArgs
- Parameters:
aExamples
- TheExample
instances to be stored.- Returns:
- The builder for applying multiple build operations.
-
withLicense
Sets the license for the license property.- Specified by:
withLicense
in interfaceLicenseAccessor.LicenseBuilder<ParseArgs>
- Specified by:
withLicense
in interfaceParseArgs
- Parameters:
aLicense
- The license to be stored by the console width property.- Returns:
- The builder for applying multiple build operations.
-
withLineBreak
- Specified by:
withLineBreak
in interfaceorg.refcodes.mixin.LineBreakAccessor.LineBreakBuilder<ParseArgs>
- Specified by:
withLineBreak
in interfaceParseArgs
-
withLineSeparatorEscapeCode
Sets the line separator Escape-Code for the line separator Escape-Code property.- Specified by:
withLineSeparatorEscapeCode
in interfaceLineSeparatorEscapeCodeAccessor.LineSeparatorEscapeCodeBuilder<ParseArgs>
- Specified by:
withLineSeparatorEscapeCode
in interfaceParseArgs
- 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
Sets the long option prefix for the long option prefix property.- Specified by:
withLongOptionPrefix
in interfaceLongOptionPrefixAccessor.LongOptionPrefixBuilder<ParseArgs>
- Specified by:
withLongOptionPrefix
in interfaceParseArgs
- Parameters:
aLongOptionPrefix
- The long option prefix to be stored by the long option prefix property.- Returns:
- The builder for applying multiple build operations.
-
withMaxConsoleWidth
- Specified by:
withMaxConsoleWidth
in interfaceorg.refcodes.mixin.MaxConsoleWidthAccessor.MaxConsoleWidthBuilder<ParseArgs>
- Specified by:
withMaxConsoleWidth
in interfaceParseArgs
-
withName
-
withOptionEscapeCode
Sets the option Escape-Code for the option Escape-Code property.- Specified by:
withOptionEscapeCode
in interfaceOptionEscapeCodeAccessor.OptionEscapeCodeBuilder<ParseArgs>
- Specified by:
withOptionEscapeCode
in interfaceParseArgs
- Parameters:
aOptEscCode
- The option Escape-Code to be stored by the option Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withResetEscapeCode
- Specified by:
withResetEscapeCode
in interfaceParseArgs
- Specified by:
withResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ParseArgs>
-
withSeparatorLnChar
Builder method adding an separator line char.- Specified by:
withSeparatorLnChar
in interfaceArgsProcessorBuilder<ParseArgs>
- Specified by:
withSeparatorLnChar
in interfaceParseArgs
- Parameters:
aSeparatorLnChar
- THe according separator line char to use.- Returns:
- This builder as of the builder pattern.
-
withShortOptionPrefix
Sets the short option prefix for the short option prefix property.- Specified by:
withShortOptionPrefix
in interfaceParseArgs
- Specified by:
withShortOptionPrefix
in interfaceShortOptionPrefixAccessor.ShortOptionPrefixBuilder<ParseArgs>
- Parameters:
aShortOptionPrefix
- The short option prefix to be stored by the short option prefix property.- Returns:
- The builder for applying multiple build operations.
-
withStandardOut
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
withStandardOut
in interfaceArgsProcessorBuilder<ParseArgs>
- Specified by:
withStandardOut
in interfaceParseArgs
- Parameters:
aStandardOut
- The standard outPrintStream
to set.- Returns:
- This instance with regard to the builder pattern.
-
withSyntaxMetrics
Sets theSyntaxMetrics
for theSyntaxMetrics
property.- Specified by:
withSyntaxMetrics
in interfaceParseArgs
- Specified by:
withSyntaxMetrics
in interfaceSyntaxMetricsAccessor.SyntaxMetricsBuilder<ParseArgs>
- Parameters:
aSyntaxMetrics
- TheSyntaxMetrics
to be stored by theSyntaxMetrics
property.- Returns:
- The builder for applying multiple build operations.
-
withSyntaxMetrics
Sets theSyntaxNotation
for theSyntaxNotation
property.- Specified by:
withSyntaxMetrics
in interfaceSyntaxMetricsAccessor.SyntaxMetricsBuilder<ParseArgs>
- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to be stored by theSyntaxNotation
property.- Returns:
- The builder for applying multiple build operations.
-
withTextBoxGrid
- Specified by:
withTextBoxGrid
in interfaceParseArgs
- Specified by:
withTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ParseArgs>
-
withTextBoxGrid
- Specified by:
withTextBoxGrid
in interfaceParseArgs
- Specified by:
withTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ParseArgs>
-
withTitle
-
getDelimiter
protected char getDelimiter()The delimiter to be used for colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs). Used when parsing args without any syntax definition.- Returns:
- The according delimiter for solving colliding command line args.
-