java.lang.Object
org.refcodes.cli.ArgsParserImpl
- All Implemented Interfaces:
ArgsParser
,ArgsParserMixin<ArgsParser>
,RootConditionAccessor
,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
,org.refcodes.mixin.NameAccessor
,org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>
,org.refcodes.mixin.NameAccessor.NameMutator
,org.refcodes.mixin.NameAccessor.NameProperty
,org.refcodes.mixin.Resetable
,org.refcodes.mixin.ResetEscapeCodeAccessor
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
,org.refcodes.mixin.TitleAccessor
,org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>
,org.refcodes.mixin.TitleAccessor.TitleMutator
,org.refcodes.mixin.TitleAccessor.TitleProperty
,org.refcodes.textual.TextBoxGridAccessor
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridBuilder<ArgsParser>
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
,org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
A straightforward implementation of the
ArgsParser
interface. The
constructor only provides means to set the required attributes as the
attributes to be adjusted optionally are already sufficiently pre-configured.
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.REFCODES
notation.
The console width id pre-configured with the console's width as determined by
the SystemUtility.getTerminalWidth()
.
The standard out PrintStream
is pre-configured 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.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.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.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.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.RootConditionAccessor
RootConditionAccessor.RootConditionBuilder<B extends RootConditionAccessor.RootConditionBuilder<B>>, RootConditionAccessor.RootConditionMutator, RootConditionAccessor.RootConditionProperty
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 theArgsParser
instance without any restrictions to the parsed arguments.ArgsParserImpl
(ArgsSyntax aRootArgsSyntax) Constructs theArgsParser
instance with the given rootArgsSyntax
and the defaultSyntaxNotation.REFCODES
.ArgsParserImpl
(Option<?> aRootOption) Constructs theArgsParser
instance with the given rootOption
and the defaultSyntaxNotation.REFCODES
. -
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 theArgsParser.withConsoleWidth(int)
method.Evaluates the provided command line arguments and determines the according values by evaluating the rootArgsSyntax
.Heuristically loads the arguments without any syntax required, e.g.The root condition is the starting point node of aSyntaxable
hierarchy to be traversed when determining the syntax for command line arguments or when evaluating the command line arguments.Retrieves the banner's border Escape-Code from the banner border Escape-Code property.Retrieves the banner's content Escape-Code from the banner Escape-Code property.Retrieves the command name's (CLI executable) Escape-Code from the command name Escape-Code property.Retrieves the copyright.protected char
Returns the delimiter to be used by colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs).Retrieves the description.Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.Retrieves theExample
instances as added usingArgsParser.addExample(String, Operand...)
.Retrieves the license.Retrieves the line separator Escape-Code from the line separator Escape-Code property.getName()
Retrieves the option Escape-Code from the option Escape-Code property.Retrieves the parameter Escape-Code from the parameter Escape-Code property.char
Gets the character to be used when printing a separator line with theArgsParser.printSeparatorLn()
method.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 theArgsParser.withCopyrightNote(String)
method; with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.void
Prints the description as set by theArgsParser.withDescription(String)
method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.void
Prints example usages as as added by theArgsParser.addExample(String, Operand...)
method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.void
Prints the header, which might be a simplified banner: Can be used when overriding methods such asArgsParser.printHelp()
orArgsParser.printBanner()
.void
Prints the license note as specified by theArgsParser.withLicenseNote(String)
method; with regards to the console width as specified by theArgsParser.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 theArgsParser.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 theArgsParser.withConsoleWidth(int)
method.void
Prints a separator line using the separator character as specified by theArgsParser.withSeparatorLnChar(char)
method; with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.void
Prints the syntax as retrieved by the rootArgsSyntax
element as ofSynopsisable.toSynopsis(SyntaxNotation)
with regards to theSyntaxNotation
set by theArgsParser.withSyntaxNotation(SyntaxNotation)
method.void
reset()
void
setBannerBorderEscapeCode
(String aBannerBorderEscCode) Sets the banner's border Escape-Code for the banner border Escape-Code property.void
setBannerEscapeCode
(String aBannerEscCode) Sets the banner's content Escape-Code for the banner Escape-Code property.void
setBannerFont
(org.refcodes.textual.Font aBannerFont) Sets the banner font.void
setBannerFontPalette
(char[] aColorPalette) Sets the banner font palette.void
setCommandEscapeCode
(String aCommandEscCode) Sets the command name's (CLI executable) Escape-Code for the command name Escape-Code property.void
setConsoleWidth
(int aConsoleWidth) Set the console with.void
setCopyrightNote
(String aCopyrightNote) Set the copyright note used by theArgsParser.printHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).void
setDescription
(String aDescription) void
setDescriptionEscapeCode
(String aDescriptionEscCode) 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 isEscCodeEnabled) void
setLicenseNote
(String aLicenseNote) Set the license note used by theArgsParser.printHelp()
method when writing out the licensing conditions.void
setLineBreak
(String aLineBreak) Set the console's line break.void
setLineSeparatorEscapeCode
(String aLineSeparatorEscCode) Sets the line separator Escape-Code for the line separator Escape-Code property.void
setMaxConsoleWidth
(int aMaxConsoleWidth) Set the maximum console width to use in case the console width is greater than the maximum you want.void
void
setOptionEscapeCode
(String aOptEscCode) Sets the option Escape-Code for the option Escape-Code property.void
setParamEscapeCode
(String aParamEscCode) Sets the parameter Escape-Code for the parameter Escape-Code property.void
setResetEscapeCode
(String aResetEscCode) void
setSeparatorLnChar
(char aSeparatorLnChar) Set the character to be used when printing a separator line with theArgsParser.printSeparatorLn()
method.void
setStandardOut
(PrintStream aStandardOut) Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).void
setSyntaxNotation
(SyntaxNotation aSyntaxNotation) Set theSyntaxNotation
.void
setTextBoxGrid
(org.refcodes.textual.TextBoxGrid aTextBoxGrid) void
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.ArgsParser
addExample, evalArgs, evalArgs, evalArgs, evalArgs, evalArgs, printBody, printHelp, withBannerBorderEscapeCode, withBannerEscapeCode, withBannerFont, withBannerFontPalette, withCommandEscapeCode, withConsoleWidth, withCopyrightNote, withDescription, withDescriptionEscapeCode, withErrorOut, withEscapeCodesEnabled, withEvalArgs, withEvalArgs, withExample, withExample, withExamples, withExamples, withLicenseNote, withLineBreak, withLineSeparatorEscapeCode, withMaxConsoleWidth, withName, withOptionEscapeCode, withParamEscapeCode, withResetEscapeCode, withSeparatorLnChar, withStandardOut, withSyntaxNotation, withTextBoxGrid, withTitle
Methods inherited from interface org.refcodes.cli.ArgsParserMixin
withEvalArgs, withEvalArgs, withEvalArgs, withEvalArgs
Methods inherited from interface org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
letDescription
Methods inherited from interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty
letEscapeCodesEnabled
Methods inherited from interface org.refcodes.mixin.NameAccessor.NameProperty
letName
Methods inherited from interface org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
letResetEscapeCode
Methods inherited from interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
letTextBoxGrid
Methods inherited from interface org.refcodes.mixin.TitleAccessor.TitleProperty
letTitle
-
Field Details
-
_stdStream
-
_errStream
-
-
Constructor Details
-
ArgsParserImpl
public ArgsParserImpl()Constructs theArgsParser
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 pre-configured. 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. -
ArgsParserImpl
Constructs theArgsParser
instance with the given rootArgsSyntax
and the defaultSyntaxNotation.REFCODES
. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently pre-configured. 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:
aRootArgsSyntax
- The root condition being the node from which parsing the command line arguments starts.
-
ArgsParserImpl
Constructs theArgsParser
instance with the given rootOption
and the defaultSyntaxNotation.REFCODES
. The constructor only provides means to set the required attributes as the attributes to be adjusted optionally are already sufficiently pre-configured. 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:
aRootOption
- The root option being the node from which parsing the command line arguments starts.
-
-
Method Details
-
getLineSeparatorEscapeCode
Retrieves the line separator Escape-Code from the line separator Escape-Code property.- Specified by:
getLineSeparatorEscapeCode
in interfaceArgsParser
- Returns:
- The line separator Escape-Code stored by the line separator Escape-Code property.
-
setLineSeparatorEscapeCode
Sets the line separator Escape-Code for the line separator Escape-Code property.- Specified by:
setLineSeparatorEscapeCode
in interfaceArgsParser
- Parameters:
aLineSeparatorEscCode
- The line separator Escape-Code to be stored by the line separator Escape-Code property.
-
getBannerEscapeCode
Retrieves the banner's content Escape-Code from the banner Escape-Code property.- Specified by:
getBannerEscapeCode
in interfaceArgsParser
- Returns:
- The banner Escape-Code stored by the banner Escape-Code property.
-
getBannerBorderEscapeCode
Retrieves the banner's border Escape-Code from the banner border Escape-Code property.- Specified by:
getBannerBorderEscapeCode
in interfaceArgsParser
- Returns:
- The banner border Escape-Code stored by the banner border Escape-Code property.
-
setBannerEscapeCode
Sets the banner's content Escape-Code for the banner Escape-Code property.- Specified by:
setBannerEscapeCode
in interfaceArgsParser
- Parameters:
aBannerEscCode
- The banner Escape-Code to be stored by the banner Escape-Code property.
-
setBannerBorderEscapeCode
Sets the banner's border Escape-Code for the banner border Escape-Code property.- Specified by:
setBannerBorderEscapeCode
in interfaceArgsParser
- Parameters:
aBannerBorderEscCode
- The banner border Escape-Code to be stored by the banner border Escape-Code property.
-
getParamEscapeCode
Retrieves the parameter Escape-Code from the parameter Escape-Code property.- Specified by:
getParamEscapeCode
in interfaceArgsParser
- Returns:
- The parameter Escape-Code stored by the parameter Escape-Code property.
-
setParamEscapeCode
Sets the parameter Escape-Code for the parameter Escape-Code property.- Specified by:
setParamEscapeCode
in interfaceArgsParser
- Parameters:
aParamEscCode
- The parameter Escape-Code to be stored by the parameter Escape-Code property.
-
getOptionEscapeCode
Retrieves the option Escape-Code from the option Escape-Code property.- Specified by:
getOptionEscapeCode
in interfaceArgsParser
- Returns:
- The option Escape-Code stored by the option Escape-Code property.
-
setOptionEscapeCode
Sets the option Escape-Code for the option Escape-Code property.- Specified by:
setOptionEscapeCode
in interfaceArgsParser
- Parameters:
aOptEscCode
- The option Escape-Code to be stored by the option Escape-Code property.
-
errorLn
Prints the given line to standard error with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
errorLn
in interfaceArgsParser
- Parameters:
aLine
- The line to be printed.
-
evalArgs
Evaluates the provided command line arguments and determines the according values by evaluating the rootArgsSyntax
. 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 theSyntaxable
instance being traversed starting at the rootArgsSyntax
will be reported. Business logic therefore should invoke this root node'sArgsParser.evalArgs(String[])
method instead of aArgsSyntax
'sSyntaxable.parseArgs(String[], String[])
method; as ignoring superfluous command line arguments will cause unexpected behavior from the point of view of the invoker.- Specified by:
evalArgs
in interfaceArgsParser
- 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.
-
getCopyrightNote
Retrieves the copyright.- Specified by:
getCopyrightNote
in interfaceArgsParser
- Returns:
- The copyright note.
-
getDelimiter
protected char getDelimiter()Returns the delimiter to be used by colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs).- Returns:
- The according delimiter.
-
getDescription
Retrieves the description.- Specified by:
getDescription
in interfaceArgsParser
- Specified by:
getDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor
- Returns:
- The description.
-
getLicenseNote
Retrieves the license.- Specified by:
getLicenseNote
in interfaceArgsParser
- Returns:
- The license note.
-
getName
- Specified by:
getName
in interfaceorg.refcodes.mixin.NameAccessor
-
getArgsSyntax
The root condition is the starting point node of aSyntaxable
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 interfaceArgsParser
- Specified by:
getArgsSyntax
in interfaceRootConditionAccessor
- Returns:
- The root
ArgsSyntax
in which's syntax this parser is based.
-
getResetEscapeCode
- Specified by:
getResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor
-
setResetEscapeCode
- Specified by:
setResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
-
getTitle
- Specified by:
getTitle
in interfaceorg.refcodes.mixin.TitleAccessor
-
printHeader
public void printHeader()Prints the header, which might be a simplified banner: Can be used when overriding methods such asArgsParser.printHelp()
orArgsParser.printBanner()
.- Specified by:
printHeader
in interfaceArgsParser
-
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 interfaceArgsParser
-
printCopyrightNote
public void printCopyrightNote()Prints the copyright note as specified by theArgsParser.withCopyrightNote(String)
method; with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printCopyrightNote
in interfaceArgsParser
-
printDescription
public void printDescription()Prints the description as set by theArgsParser.withDescription(String)
method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printDescription
in interfaceArgsParser
-
printLicenseNote
public void printLicenseNote()Prints the license note as specified by theArgsParser.withLicenseNote(String)
method; with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printLicenseNote
in interfaceArgsParser
-
printLn
public void printLn()Prints an empty line / a line break.- Specified by:
printLn
in interfaceArgsParser
-
printLn
Prints the given line to standard out with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printLn
in interfaceArgsParser
- Parameters:
aLine
- The line to be printed.
-
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 theArgsParser.withConsoleWidth(int)
method.- Specified by:
printOptions
in interfaceArgsParser
-
printExamples
public void printExamples()Prints example usages as as added by theArgsParser.addExample(String, Operand...)
method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printExamples
in interfaceArgsParser
-
printSeparatorLn
public void printSeparatorLn()Prints a separator line using the separator character as specified by theArgsParser.withSeparatorLnChar(char)
method; with regards to the console width as specified by theArgsParser.withConsoleWidth(int)
method.- Specified by:
printSeparatorLn
in interfaceArgsParser
-
printSynopsis
public void printSynopsis()Prints the syntax as retrieved by the rootArgsSyntax
element as ofSynopsisable.toSynopsis(SyntaxNotation)
with regards to theSyntaxNotation
set by theArgsParser.withSyntaxNotation(SyntaxNotation)
method.- Specified by:
printSynopsis
in interfaceArgsParser
-
reset
public void reset()- Specified by:
reset
in interfaceorg.refcodes.mixin.Resetable
-
setBannerFont
public void setBannerFont(org.refcodes.textual.Font aBannerFont) Sets the banner font.- Specified by:
setBannerFont
in interfaceArgsParser
- Parameters:
aBannerFont
- the new banner font
-
setBannerFontPalette
public void setBannerFontPalette(char[] aColorPalette) Sets the banner font palette.- Specified by:
setBannerFontPalette
in interfaceArgsParser
- Parameters:
aColorPalette
- the new banner font palette
-
setConsoleWidth
public void setConsoleWidth(int aConsoleWidth) Set the console with. A setting of "-1" makes the instance use theSystemUtility.getTerminalWidth()
value, i.e. the console width is set automatically to be the width of your terminal.- Specified by:
setConsoleWidth
in interfaceArgsParser
- Parameters:
aConsoleWidth
- The width to set or -1 to let the parser automatically determine the console width.
-
setCopyrightNote
Set the copyright note used by theArgsParser.printHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setCopyrightNote
in interfaceArgsParser
- Parameters:
aCopyrightNote
- The license note printed out by theArgsParser.printHelp()
method.
-
setDescription
- Specified by:
setDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor.DescriptionMutator
-
setErrorOut
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setErrorOut
in interfaceArgsParser
- Parameters:
aErrorOut
- The error outPrintStream
to set.
-
isEscapeCodesEnabled
public boolean isEscapeCodesEnabled()- Specified by:
isEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor
-
setEscapeCodesEnabled
public void setEscapeCodesEnabled(boolean isEscCodeEnabled) - Specified by:
setEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
-
getDescriptionEscapeCode
Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.- Specified by:
getDescriptionEscapeCode
in interfaceArgsParser
- Returns:
- The description Escape-Code stored by the description Escape-Code property.
-
setDescriptionEscapeCode
Sets the description Escape-Code for the description Escape-Code property.- Specified by:
setDescriptionEscapeCode
in interfaceArgsParser
- Parameters:
aDescriptionEscCode
- The description Escape-Code to be stored by the description Escape-Code property.
-
getCommandEscapeCode
Retrieves the command name's (CLI executable) Escape-Code from the command name Escape-Code property.- Specified by:
getCommandEscapeCode
in interfaceArgsParser
- Returns:
- The command name's Escape-Code stored by the command name Escape-Code property.
-
setCommandEscapeCode
Sets the command name's (CLI executable) Escape-Code for the command name Escape-Code property.- Specified by:
setCommandEscapeCode
in interfaceArgsParser
- Parameters:
aCommandEscCode
- The command name's Escape-Code to stored by the command name Escape-Code property.
-
setLicenseNote
Set the license note used by theArgsParser.printHelp()
method when writing out the licensing conditions.- Specified by:
setLicenseNote
in interfaceArgsParser
- Parameters:
aLicenseNote
- The license note printed out by theArgsParser.printHelp()
method.
-
setLineBreak
Set the console's line break. A setting of null makes the instance use theSystemUtility.getLineBreak()
value.- Specified by:
setLineBreak
in interfaceArgsParser
- Parameters:
aLineBreak
- the new line break
-
setMaxConsoleWidth
public 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.- Specified by:
setMaxConsoleWidth
in interfaceArgsParser
- Parameters:
aMaxConsoleWidth
- the new max console width
-
setName
- Specified by:
setName
in interfaceorg.refcodes.mixin.NameAccessor.NameMutator
-
setSeparatorLnChar
public void setSeparatorLnChar(char aSeparatorLnChar) Set the character to be used when printing a separator line with theArgsParser.printSeparatorLn()
method.- Specified by:
setSeparatorLnChar
in interfaceArgsParser
- Parameters:
aSeparatorLnChar
- The character used by theArgsParser.printSeparatorLn()
method when printing out the line of characters..
-
getSeparatorLnChar
public char getSeparatorLnChar()Gets the character to be used when printing a separator line with theArgsParser.printSeparatorLn()
method.- Specified by:
getSeparatorLnChar
in interfaceArgsParser
- Returns:
- aSeparatorChar The character used by the
ArgsParser.printSeparatorLn()
method when printing out the line of characters..
-
setStandardOut
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setStandardOut
in interfaceArgsParser
- Parameters:
aStandardOut
- The standard outPrintStream
to set.
-
setSyntaxNotation
Set theSyntaxNotation
.- Specified by:
setSyntaxNotation
in interfaceArgsParser
- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to set.
-
setTitle
- Specified by:
setTitle
in interfaceorg.refcodes.mixin.TitleAccessor.TitleMutator
-
getTextBoxGrid
public org.refcodes.textual.TextBoxGrid getTextBoxGrid()- Specified by:
getTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor
-
setTextBoxGrid
public void setTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid) - Specified by:
setTextBoxGrid
in interfaceorg.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
-
getExamples
Retrieves theExample
instances as added usingArgsParser.addExample(String, Operand...)
.- Specified by:
getExamples
in interfaceArgsParser
- Returns:
- The according
Example
elements.
-
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 interfaceArgsParser
- Parameters:
aExampleUsage
- The description as well as the command line arguments used by the example.
-
fromArgs
Heuristically loads the arguments without any syntax required, e.g. without any rootArgsSyntax
to be set.- Parameters:
aArgs
- The arguments to be loaded.aDelimiter
- The delimiter to resolve name clashes.- Returns:
- A list of heuristically determined
Flag
andStringOperand
instances.
-