java.lang.Object
org.refcodes.cli.ArgsParserImpl
- All Implemented Interfaces:
ArgsParser,ArgsParserMixin<ArgsParser>,RootConditionAccessor,org.refcodes.component.Resetable,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.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
public class ArgsParserImpl extends Object implements ArgsParser
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.DescriptionPropertyNested 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.EscapeCodeStatusPropertyNested 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.NamePropertyNested 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.ResetEscapeCodePropertyNested classes/interfaces inherited from interface org.refcodes.cli.RootConditionAccessor
RootConditionAccessor.RootConditionBuilder<B extends RootConditionAccessor.RootConditionBuilder<B>>, RootConditionAccessor.RootConditionMutator, RootConditionAccessor.RootConditionPropertyNested 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.TextBoxGridPropertyNested 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
Fields Modifier and Type Field Description protected PrintStream_errStreamprotected PrintStream_stdStream -
Constructor Summary
Constructors Constructor Description ArgsParserImpl()Constructs theArgsParserinstance without any restrictions to the parsed arguments.ArgsParserImpl(Condition aRootCondition)Constructs theArgsParserinstance with the given rootConditionand the defaultSyntaxNotation.REFCODES.ArgsParserImpl(Option<?> aRootOption)Constructs theArgsParserinstance with the given rootOptionand the defaultSyntaxNotation.REFCODES. -
Method Summary
Modifier and Type Method Description voidaddExampleUsage(String aDescription, Operand<?>... aOperands)Adds a usage example by providing a description of the example and the command line arguments required by the example.voiderrorLn(String aLine)Prints the given line to standard error with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.List<? extends Operand<?>>evalArgs(String[] aArgs)Evaluates the provided command line arguments and determines the according values by evaluating the rootCondition.protected static List<? extends Operand<?>>fromArgs(String[] aArgs, char aDelimiter)Heuristically loads the arguments without any syntax required, e.g.StringgetBannerBorderEscapeCode()Retrieves the banner's border Escape-Code from the banner border Escape-Code property.StringgetBannerEscapeCode()Retrieves the banner's content Escape-Code from the banner Escape-Code property.StringgetCopyrightNote()Retrieves the copyright.protected chargetDelimiter()Returns the delimiter to be used by colliding command line args when creating non colliding arg's aliases (keys for key/value-pairs).StringgetDescription()Retrieves the description.StringgetDescriptionEscapeCode()Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.List<ExampleUsage>getExampleUsages()Retrieves theExampleUsageinstances as addeed usingArgsParser.addExampleUsage(String, Operand...).StringgetLicenseNote()Retrieves the license.StringgetLineSeparatorEscapeCode()Retrieves the line separator Escape-Code from the line separator Escape-Code property.StringgetName()StringgetParameterEscapeCode()Retrieves the parameter Escape-Code from the parameter Escape-Code property.StringgetResetEscapeCode()ConditiongetRootCondition()The root condition is the starting point node of aSyntaxablehierarchy to be traversed when determining the syntax for command line arguments or when evaluating the command line arguments.chargetSeparatorLnChar()Gets the character to be used when printing a separator line with theArgsParser.printSeparatorLn()method.org.refcodes.textual.TextBoxGridgetTextBoxGrid()StringgetTitle()booleanisEscapeCodesEnabled()voidprintBanner()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.voidprintCopyrightNote()Prints the copyright note as specified by theArgsParser.withCopyrightNote(String)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintDescription()Prints the description as set by theArgsParser.withDescription(String)method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintExampleUsages()Prints example usages as as added by theArgsParser.addExampleUsage(String, Operand...)method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintLicenseNote()Prints the license note as specified by theArgsParser.withLicenseNote(String)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintLn()Prints an empty line / a line break.voidprintLn(String aLine)Prints the given line to standard out with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintOptions()Prints theOptions (short- and the long-options), theFlages and theOperandand their description with regards to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintSeparatorLn()Prints a separator line using the separator character as specified by theArgsParser.withSeparatorLnChar(char)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.voidprintUsage()Prints the syntax as retrieved by the rootConditionwith regards to theSyntaxNotationset by theArgsParser.withSyntaxNotation(SyntaxNotation)method; making use of the usage label as passed by theArgsParser.withUsageLabel(String)method.voidreset()voidsetBannerBorderEscapeCode(String aBannerBorderEscCode)Sets the banner's border Escape-Code for the banner border Escape-Code property.voidsetBannerEscapeCode(String aBannerEscCode)Sets the banner's content Escape-Code for the banner Escape-Code property.voidsetBannerFont(org.refcodes.textual.Font aBannerFont)Sets the banner font.voidsetBannerFontPalette(char[] aColorPalette)Sets the banner font palette.voidsetConsoleWidth(int aConsoleWidth)Set the console with.voidsetCopyrightNote(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).voidsetDescription(String aDescription)voidsetDescriptionEscapeCode(String aDescriptionEscCode)Sets the description Escape-Code for the description Escape-Code property.voidsetErrorOut(PrintStream aErrorOut)Set the error outPrintStreamand make other adjustments with the result (with regards to the Builder-Pattern).voidsetEscapeCodesEnabled(boolean isEscCodeEnabled)voidsetLicenseNote(String aLicenseNote)Set the license note used by theArgsParser.printHelp()method when writing out the licensing conditions.voidsetLineBreak(String aLineBreak)Set the console's line break.voidsetLineSeparatorEscapeCode(String aLineSeparatorEscCode)Sets the line separator Escape-Code for the line separator Escape-Code property.voidsetMaxConsoleWidth(int aMaxConsoleWidth)Set the maximum console width to use in case the console width is greater than the maximum you want.voidsetName(String aName)voidsetParameterEscapeCode(String aParamEscCode)Sets the parameter Escape-Code for the parameter Escape-Code property.voidsetResetEscapeCode(String aResetEscCode)voidsetSeparatorLnChar(char aSeparatorLnChar)Set the character to be used when printing a separator line with theArgsParser.printSeparatorLn()method.voidsetStandardOut(PrintStream aStandardOut)Set the standard outPrintStreamand make other adjustments with the result (with regards to the Builder-Pattern).voidsetSyntaxNotation(SyntaxNotation aSyntaxNotation)Set theSyntaxNotation.voidsetTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid)voidsetTitle(String aTitle)voidsetUsageLabel(String aUsageLabel)Set the usage label used by theArgsParser.printHelp()method when writing out the syntax.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.cli.ArgsParser
evalArgs, printBody, printHelp, withBannerBorderEscapeCode, withBannerEscapeCode, withBannerFont, withBannerFontPalette, withConsoleWidth, withCopyrightNote, withDescription, withDescriptionEscapeCode, withErrorOut, withEscapeCodesEnabled, withEvalArgs, withEvalArgs, withExampleUsage, withLicenseNote, withLineBreak, withLineSeparatorEscapeCode, withMaxConsoleWidth, withName, withParameterEscapeCode, withResetEscapeCode, withSeparatorLnChar, withStandardOut, withSyntaxNotation, withTextBoxGrid, withTitle, withUsageLabelMethods inherited from interface org.refcodes.mixin.DescriptionAccessor.DescriptionProperty
letDescriptionMethods inherited from interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty
letEscapeCodesEnabledMethods inherited from interface org.refcodes.mixin.NameAccessor.NameProperty
letNameMethods inherited from interface org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
letResetEscapeCodeMethods inherited from interface org.refcodes.textual.TextBoxGridAccessor.TextBoxGridProperty
letTextBoxGridMethods inherited from interface org.refcodes.mixin.TitleAccessor.TitleProperty
letTitle
-
Field Details
-
_stdStream
-
_errStream
-
-
Constructor Details
-
ArgsParserImpl
public ArgsParserImpl()Constructs theArgsParserinstance 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 theArgsParserinstance with the given rootConditionand 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:
aRootCondition- The root condition being the node from which parsing the command line arguments starts.
-
ArgsParserImpl
Constructs theArgsParserinstance with the given rootOptionand 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:
getLineSeparatorEscapeCodein 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:
setLineSeparatorEscapeCodein 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:
getBannerEscapeCodein 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:
getBannerBorderEscapeCodein 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:
setBannerEscapeCodein 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:
setBannerBorderEscapeCodein interfaceArgsParser- Parameters:
aBannerBorderEscCode- The banner border Escape-Code to be stored by the banner border Escape-Code property.
-
getParameterEscapeCode
Retrieves the parameter Escape-Code from the parameter Escape-Code property.- Specified by:
getParameterEscapeCodein interfaceArgsParser- Returns:
- The parameter Escape-Code stored by the parameter Escape-Code property.
-
setParameterEscapeCode
Sets the parameter Escape-Code for the parameter Escape-Code property.- Specified by:
setParameterEscapeCodein interfaceArgsParser- Parameters:
aParamEscCode- The parameter Escape-Code to be stored by the parameter Escape-Code property.
-
errorLn
Prints the given line to standard error with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
errorLnin interfaceArgsParser- Parameters:
aLine- The line to be printed.
-
evalArgs
public List<? extends Operand<?>> evalArgs(String[] aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsExceptionEvaluates 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 theSyntaxableinstance being traversed starting at the rootConditionwill be reported. Business logic therefore should invoke this root node'sArgsParser.evalArgs(String[])method instead of aCondition'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:
evalArgsin interfaceArgsParser- Parameters:
aArgs- The command line arguments to be evaluated.- Returns:
- The list of evaluated command line arguments being instances of
the
Operandinterfaces or its sub-types. - Throws:
UnknownArgsException- Thrown in case not one command line argument matched regarding the provided args vs. the expected args.AmbiguousArgsException- Thrown in case at least one command line argument is ambiguous regarding expected args vs. provided args.SuperfluousArgsException- Thrown in case there were arguments found not being used (superfluous arguments).ParseArgsException- Thrown in case the provided command line arguments do not respect the required syntax or cannot be converted to the required type
-
getCopyrightNote
Retrieves the copyright.- Specified by:
getCopyrightNotein 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:
getDescriptionin interfaceArgsParser- Specified by:
getDescriptionin interfaceorg.refcodes.mixin.DescriptionAccessor- Returns:
- The description.
-
getLicenseNote
Retrieves the license.- Specified by:
getLicenseNotein interfaceArgsParser- Returns:
- The license note.
-
getName
- Specified by:
getNamein interfaceorg.refcodes.mixin.NameAccessor
-
getRootCondition
The root condition is the starting point node of aSyntaxablehierarchy 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:
getRootConditionin interfaceArgsParser- Specified by:
getRootConditionin interfaceRootConditionAccessor- Returns:
- The root
Conditionin which's syntax this parser is based.
-
getResetEscapeCode
- Specified by:
getResetEscapeCodein interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor
-
setResetEscapeCode
- Specified by:
setResetEscapeCodein interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
-
getTitle
- Specified by:
getTitlein interfaceorg.refcodes.mixin.TitleAccessor
-
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:
printBannerin interfaceArgsParser
-
printCopyrightNote
public void printCopyrightNote()Prints the copyright note as specified by theArgsParser.withCopyrightNote(String)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printCopyrightNotein 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:
printDescriptionin interfaceArgsParser
-
printLicenseNote
public void printLicenseNote()Prints the license note as specified by theArgsParser.withLicenseNote(String)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printLicenseNotein interfaceArgsParser
-
printLn
public void printLn()Prints an empty line / a line break.- Specified by:
printLnin interfaceArgsParser
-
printLn
Prints the given line to standard out with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printLnin interfaceArgsParser- Parameters:
aLine- The line to be printed.
-
printOptions
public void printOptions()Prints theOptions (short- and the long-options), theFlages and theOperandand their description with regards to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printOptionsin interfaceArgsParser
-
printExampleUsages
public void printExampleUsages()Prints example usages as as added by theArgsParser.addExampleUsage(String, Operand...)method with regards to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printExampleUsagesin interfaceArgsParser
-
printSeparatorLn
public void printSeparatorLn()Prints a separator line using the separator character as specified by theArgsParser.withSeparatorLnChar(char)method; with regards to to the console width as specified by theArgsParser.withConsoleWidth(int)method.- Specified by:
printSeparatorLnin interfaceArgsParser
-
printUsage
public void printUsage()Prints the syntax as retrieved by the rootConditionwith regards to theSyntaxNotationset by theArgsParser.withSyntaxNotation(SyntaxNotation)method; making use of the usage label as passed by theArgsParser.withUsageLabel(String)method.- Specified by:
printUsagein interfaceArgsParser
-
reset
public void reset()- Specified by:
resetin interfaceorg.refcodes.component.Resetable
-
setBannerFont
public void setBannerFont(org.refcodes.textual.Font aBannerFont)Sets the banner font.- Specified by:
setBannerFontin interfaceArgsParser- Parameters:
aBannerFont- the new banner font
-
setBannerFontPalette
public void setBannerFontPalette(char[] aColorPalette)Sets the banner font palette.- Specified by:
setBannerFontPalettein 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:
setConsoleWidthin 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:
setCopyrightNotein interfaceArgsParser- Parameters:
aCopyrightNote- The license note printed out by theArgsParser.printHelp()method.
-
setDescription
- Specified by:
setDescriptionin interfaceorg.refcodes.mixin.DescriptionAccessor.DescriptionMutator
-
setErrorOut
Set the error outPrintStreamand make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setErrorOutin interfaceArgsParser- Parameters:
aErrorOut- The error outPrintStreamto set.
-
isEscapeCodesEnabled
public boolean isEscapeCodesEnabled()- Specified by:
isEscapeCodesEnabledin interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor
-
setEscapeCodesEnabled
public void setEscapeCodesEnabled(boolean isEscCodeEnabled)- Specified by:
setEscapeCodesEnabledin interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
-
getDescriptionEscapeCode
Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.- Specified by:
getDescriptionEscapeCodein 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:
setDescriptionEscapeCodein interfaceArgsParser- Parameters:
aDescriptionEscCode- The description Escape-Code to be stored by the description Escape-Code property.
-
setLicenseNote
Set the license note used by theArgsParser.printHelp()method when writing out the licensing conditions.- Specified by:
setLicenseNotein 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:
setLineBreakin 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:
setMaxConsoleWidthin interfaceArgsParser- Parameters:
aMaxConsoleWidth- the new max console width
-
setName
- Specified by:
setNamein 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:
setSeparatorLnCharin 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:
getSeparatorLnCharin interfaceArgsParser- Returns:
- aSeparatorChar The character used by the
ArgsParser.printSeparatorLn()method when printing out the line of characters..
-
setStandardOut
Set the standard outPrintStreamand make other adjustments with the result (with regards to the Builder-Pattern).- Specified by:
setStandardOutin interfaceArgsParser- Parameters:
aStandardOut- The standard outPrintStreamto set.
-
setSyntaxNotation
Set theSyntaxNotation.- Specified by:
setSyntaxNotationin interfaceArgsParser- Parameters:
aSyntaxNotation- TheSyntaxNotationto set.
-
setTitle
- Specified by:
setTitlein interfaceorg.refcodes.mixin.TitleAccessor.TitleMutator
-
setUsageLabel
Set the usage label used by theArgsParser.printHelp()method when writing out the syntax.- Specified by:
setUsageLabelin interfaceArgsParser- Parameters:
aUsageLabel- The usage label printed out by theArgsParser.printHelp()method.
-
getTextBoxGrid
public org.refcodes.textual.TextBoxGrid getTextBoxGrid()- Specified by:
getTextBoxGridin interfaceorg.refcodes.textual.TextBoxGridAccessor
-
setTextBoxGrid
public void setTextBoxGrid(org.refcodes.textual.TextBoxGrid aTextBoxGrid)- Specified by:
setTextBoxGridin interfaceorg.refcodes.textual.TextBoxGridAccessor.TextBoxGridMutator
-
getExampleUsages
Retrieves theExampleUsageinstances as addeed usingArgsParser.addExampleUsage(String, Operand...).- Specified by:
getExampleUsagesin interfaceArgsParser- Returns:
- The according
ExampleUsageelements.
-
addExampleUsage
Adds a usage example by providing a description of the example and the command line arguments required by the example.- Specified by:
addExampleUsagein interfaceArgsParser- Parameters:
aDescription- The description of the example.aOperands- The command line arguments used by the example.
-
fromArgs
Heuristically loads the arguments without any syntax required, e.g. without any rootConditionto be set.- Parameters:
aArgs- The arguments to be loaded.aDelimiter- The delimiter to resolve name clashes.- Returns:
- A list of heuristically determined
FlagandStringOperandinstances.
-