Package org.refcodes.console
Interface ArgsParser
-
- All Superinterfaces:
ArgsParserMixin<ArgsParser>
,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.component.Resetable
,org.refcodes.mixin.ResetEscapeCodeAccessor
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeMutator
,org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty
,RootConditionAccessor
,org.refcodes.mixin.TitleAccessor
,org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>
,org.refcodes.mixin.TitleAccessor.TitleMutator
,org.refcodes.mixin.TitleAccessor.TitleProperty
- All Known Implementing Classes:
ArgsParserImpl
public interface ArgsParser extends ArgsParserMixin<ArgsParser>, org.refcodes.mixin.TitleAccessor.TitleProperty, org.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>, org.refcodes.mixin.NameAccessor.NameProperty, org.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>, org.refcodes.mixin.DescriptionAccessor.DescriptionProperty, org.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>, org.refcodes.component.Resetable, RootConditionAccessor, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusProperty, org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeProperty, org.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>
TheArgsParser
provides means for parsing command line arguments and constructing a command line utility's help output.
-
-
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.console.RootConditionAccessor
RootConditionAccessor.RootConditionBuilder<B extends RootConditionAccessor.RootConditionBuilder<B>>, RootConditionAccessor.RootConditionMutator, RootConditionAccessor.RootConditionProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
errorLn(java.lang.String aLine)
Prints the given line to standard error with regards to to the console width as specified by thewithConsoleWidth(int)
method.java.util.List<? extends Operand<?>>
evalArgs(java.lang.String[] aArgs)
Evaluates the provided command line arguments and determines the according values by evaluating the rootCondition
.default java.util.List<? extends Operand<?>>
evalArgs(java.util.List<java.lang.String> aArgs)
Same asevalArgs(String[])
with the difference that the elements representing the arguments are passed as a list instead of an array.java.lang.String
getBannerBorderEscapeCode()
Retrieves the banner's border Escape-Code from the banner border Escape-Code property.java.lang.String
getBannerEscapeCode()
Retrieves the banner's content Escape-Code from the banner Escape-Code property.java.lang.String
getCopyrightNote()
Retrieves the copyright.java.lang.String
getDescription()
Retrieves the description.java.lang.String
getLicenseNote()
Retrieves the license.java.lang.String
getLineSeparatorEscapeCode()
Retrieves the line separator Escape-Code from the line separator Escape-Code property.java.lang.String
getParameterDescriptionEscapeCode()
Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.java.lang.String
getParameterEscapeCode()
Retrieves the parameter Escape-Code from the parameter Escape-Code property.Condition
getRootCondition()
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.void
printBanner()
Prints the banner; the banner most probably is an ASCII art text block which's look depends strongly on the taste of the author implementing this interface.default void
printBody()
Prints the help as ofprintHelp()
without the banner.void
printCopyrightNote()
Prints the copyright note as specified by thewithCopyrightNote(String)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.void
printDescription()
Prints the description as set by thewithDescription(String)
method with regards to the console width as specified by thewithConsoleWidth(int)
method.default void
printHelp()
Prints the help to the standard output specified by thewithStandardOut(PrintStream)
method.void
printLicenseNote()
Prints the license note as specified by thewithLicenseNote(String)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.void
printLn()
Prints an empty line / a line break.void
printLn(java.lang.String aLine)
Prints the given line to standard out with regards to to the console width as specified by thewithConsoleWidth(int)
method.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 thewithConsoleWidth(int)
method.void
printSeparatorLn()
Prints a separator line using the separator character as specified by thewithSeparatorChar(char)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.void
printUsage()
Prints the syntax as retrieved by the rootCondition
with regards to theSyntaxNotation
set by thewithSyntaxNotation(SyntaxNotation)
method; making use of the usage label as passed by thewithUsageLabel(String)
method.void
setBannerBorderEscapeCode(java.lang.String aBannerBorderEscCode)
Sets the banner's border Escape-Code for the banner border Escape-Code property.void
setBannerEscapeCode(java.lang.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
setConsoleWidth(int aConsoleWidth)
Set the console with.void
setCopyrightNote(java.lang.String aCopyrightNote)
Set the copyright note used by theprintHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).void
setErrorOut(java.io.PrintStream aErrorOut)
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).void
setLicenseNote(java.lang.String aLicenseNote)
Set the license note used by theprintHelp()
method when writing out the licensing conditions.void
setLineBreak(java.lang.String aLineBreak)
Set the console's line break.void
setLineSeparatorEscapeCode(java.lang.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
setParameterDescriptionEscapeCode(java.lang.String aParamDescriptionEscCode)
Sets the parameter's description Escape-Code for the parameter's description Escape-Code property.void
setParameterEscapeCode(java.lang.String aParamEscCode)
Sets the parameter Escape-Code for the parameter Escape-Code property.void
setSeparatorChar(char aSeparatorChar)
Set the character to be used when printing a separator line with theprintSeparatorLn()
method.void
setStandardOut(java.io.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
setUsageLabel(java.lang.String aUsageLabel)
Set the usage label used by theprintHelp()
method when writing out the syntax.default ArgsParser
withBannerBorderEscapeCode(java.lang.String aBannerBorderEscCode)
Sets the banner's border Escape-Code for the banner border Escape-Code property.default ArgsParser
withBannerEscapeCode(java.lang.String aBannerEscCode)
Sets the banner's content Escape-Code for the banner Escape-Code property.default ArgsParser
withBannerFont(org.refcodes.textual.Font aBannerFont)
With banner font.default ArgsParser
withBannerFontPalette(char[] aColorPalette)
With banner font palette.default ArgsParser
withConsoleWidth(int aConsoleWidth)
Set the console with.default ArgsParser
withCopyrightNote(java.lang.String aCopyrightNote)
Set the copyright note used by theprintHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).default ArgsParser
withDescription(java.lang.String aDescription)
With description.default ArgsParser
withErrorOut(java.io.PrintStream aErrorOut)
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).default ArgsParser
withEscapeCodesEnabled(boolean isEscCodeEnabled)
default ArgsParser
withEvalArgs(java.lang.String[] aArgs)
Same asevalArgs(String[])
with the difference that this class's instance being invoked is returned as of the builder pattern.default ArgsParser
withEvalArgs(java.util.List<java.lang.String> aArgs)
Same asevalArgs(List)
with the difference that this class's instance being invoked is returned as of the builder pattern.default ArgsParser
withLicenseNote(java.lang.String aLicenseNote)
Set the license note used by theprintHelp()
method when writing out the licensing conditions and make other adjustments with the result (with regards to the Builder-Pattern).default ArgsParser
withLineBreak(java.lang.String aLineBreak)
Set the console's line break.default ArgsParser
withLineSeparatorEscapeCode(java.lang.String aLineSeparatorEscCode)
Sets the line separator Escape-Code for the line separator Escape-Code property.default ArgsParser
withMaxConsoleWidth(int aMaxConsoleWidth)
Set the maximum console width to use in case the console width is greater than the maximum you want.default ArgsParser
withName(java.lang.String aName)
With name.default ArgsParser
withParameterDescriptionEscapeCode(java.lang.String aParamDescriptionEscCode)
Sets the parameter's description Escape-Code for the parameter's description Escape-Code property.default ArgsParser
withParameterEscapeCode(java.lang.String aParamEscCode)
Sets the parameter Escape-Code for the parameter Escape-Code property.default ArgsParser
withParseArgs(java.lang.String[] aArgs)
CallsevalArgs(String[])
and returns this invoked instance as of the builder pattern.default ArgsParser
withResetEscapeCode(java.lang.String aResetEscCode)
default ArgsParser
withSeparatorChar(char aSeparatorChar)
Set the character to be used when printing a separator line with theprintSeparatorLn()
method.default ArgsParser
withStandardOut(java.io.PrintStream aStandardOut)
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).default ArgsParser
withSyntaxNotation(SyntaxNotation aSyntaxNotation)
Set theSyntaxNotation
and make other adjustments with the result (with regards to the Builder-Pattern).default ArgsParser
withTitle(java.lang.String aTitle)
With title.default ArgsParser
withUsageLabel(java.lang.String aUsageLabel)
Set the usage label used by theprintHelp()
method when writing out the syntax and make other adjustments with the result (with regards to the Builder-Pattern).-
Methods inherited from interface org.refcodes.console.ArgsParserMixin
withParseArgs
-
Methods inherited from interface org.refcodes.mixin.DescriptionAccessor.DescriptionMutator
setDescription
-
Methods inherited from interface org.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusMutator
setEscapeCodesEnabled
-
-
-
-
Method Detail
-
errorLn
void errorLn(java.lang.String aLine)
Prints the given line to standard error with regards to to the console width as specified by thewithConsoleWidth(int)
method.- Parameters:
aLine
- The line to be printed.
-
evalArgs
default java.util.List<? extends Operand<?>> evalArgs(java.util.List<java.lang.String> aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsException
Same asevalArgs(String[])
with the difference that the elements representing the arguments are passed as a list instead of an array.- Parameters:
aArgs
- The command line arguments to be evaluated.- Returns:
- The list of evaluated command line arguments being instances of
the
Operand
interfaces or its sub-types. - Throws:
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
-
evalArgs
java.util.List<? extends Operand<?>> evalArgs(java.lang.String[] aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsException
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 theSyntaxable
instance being traversed starting at the rootCondition
will be reported. Business logic therefore should invoke this root node'sevalArgs(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.- 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:
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
java.lang.String getCopyrightNote()
Retrieves the copyright.- Returns:
- The copyright note.
-
getDescription
java.lang.String getDescription()
Retrieves the description.- Specified by:
getDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor
- Returns:
- The description.
-
getLicenseNote
java.lang.String getLicenseNote()
Retrieves the license.- Returns:
- The license note.
-
getParameterDescriptionEscapeCode
java.lang.String getParameterDescriptionEscapeCode()
Retrieves the parameter's description Escape-Code from the parameter's description Escape-Code property.- Returns:
- The parameter's description Escape-Code stored by the parameter's description Escape-Code property.
-
getParameterEscapeCode
java.lang.String getParameterEscapeCode()
Retrieves the parameter Escape-Code from the parameter Escape-Code property.- Returns:
- The parameter Escape-Code stored by the parameter Escape-Code property.
-
getBannerEscapeCode
java.lang.String getBannerEscapeCode()
Retrieves the banner's content Escape-Code from the banner Escape-Code property.- Returns:
- The banner Escape-Code stored by the banner Escape-Code property.
-
getLineSeparatorEscapeCode
java.lang.String getLineSeparatorEscapeCode()
Retrieves the line separator Escape-Code from the line separator Escape-Code property.- Returns:
- The line separator Escape-Code stored by the line separator Escape-Code property.
-
getBannerBorderEscapeCode
java.lang.String getBannerBorderEscapeCode()
Retrieves the banner's border Escape-Code from the banner border Escape-Code property.- Returns:
- The banner border Escape-Code stored by the banner border Escape-Code property.
-
getRootCondition
Condition getRootCondition()
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 rootCondition from the rootCondition property.- Specified by:
getRootCondition
in interfaceRootConditionAccessor
- Returns:
- The root
Condition
in which's syntax this parser is based.
-
printBanner
void printBanner()
Prints the banner; the banner most probably is an ASCII art text block which's look depends strongly on the taste of the author implementing this interface.
-
printBody
default void printBody()
Prints the help as ofprintHelp()
without the banner.
-
printCopyrightNote
void printCopyrightNote()
Prints the copyright note as specified by thewithCopyrightNote(String)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.
-
printDescription
void printDescription()
Prints the description as set by thewithDescription(String)
method with regards to the console width as specified by thewithConsoleWidth(int)
method.
-
printHelp
default void printHelp()
Prints the help to the standard output specified by thewithStandardOut(PrintStream)
method. This method can make use of the more atomic methodsprintBanner()
,printUsage()
,printDescription()
,printOptions()
orprintSeparatorLn()
to print a help text which's look depends strongly on the taste of the author implementing this interface. In case you dislike the implementing author's taste, feel free to overwrite this method and compose your own help text from the building blocks such asprintBanner()
,printUsage()
,printDescription()
,printOptions()
orprintSeparatorLn()
-
printLicenseNote
void printLicenseNote()
Prints the license note as specified by thewithLicenseNote(String)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.
-
printLn
void printLn()
Prints an empty line / a line break.
-
printLn
void printLn(java.lang.String aLine)
Prints the given line to standard out with regards to to the console width as specified by thewithConsoleWidth(int)
method.- Parameters:
aLine
- The line to be printed.
-
printOptions
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 thewithConsoleWidth(int)
method.
-
printSeparatorLn
void printSeparatorLn()
Prints a separator line using the separator character as specified by thewithSeparatorChar(char)
method; with regards to to the console width as specified by thewithConsoleWidth(int)
method.
-
printUsage
void printUsage()
Prints the syntax as retrieved by the rootCondition
with regards to theSyntaxNotation
set by thewithSyntaxNotation(SyntaxNotation)
method; making use of the usage label as passed by thewithUsageLabel(String)
method.
-
setBannerFont
void setBannerFont(org.refcodes.textual.Font aBannerFont)
Sets the banner font.- Parameters:
aBannerFont
- the new banner font
-
setBannerFontPalette
void setBannerFontPalette(char[] aColorPalette)
Sets the banner font palette.- Parameters:
aColorPalette
- the new banner font palette
-
setConsoleWidth
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.- Parameters:
aConsoleWidth
- The width to set or -1 to let the parser automatically determine the console width.
-
setCopyrightNote
void setCopyrightNote(java.lang.String aCopyrightNote)
Set the copyright note used by theprintHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aCopyrightNote
- The license note printed out by theprintHelp()
method.
-
setErrorOut
void setErrorOut(java.io.PrintStream aErrorOut)
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aErrorOut
- The error outPrintStream
to set.
-
setLicenseNote
void setLicenseNote(java.lang.String aLicenseNote)
Set the license note used by theprintHelp()
method when writing out the licensing conditions.- Parameters:
aLicenseNote
- The license note printed out by theprintHelp()
method.
-
setLineBreak
void setLineBreak(java.lang.String aLineBreak)
Set the console's line break. A setting of null makes the instance use theSystemUtility.getLineBreak()
value.- Parameters:
aLineBreak
- the new line break
-
setMaxConsoleWidth
void setMaxConsoleWidth(int aMaxConsoleWidth)
Set the maximum console width to use in case the console width is greater than the maximum you want. This is most useful when the console width is determined automatically to be the width of your terminal.- Parameters:
aMaxConsoleWidth
- the new max console width
-
setParameterDescriptionEscapeCode
void setParameterDescriptionEscapeCode(java.lang.String aParamDescriptionEscCode)
Sets the parameter's description Escape-Code for the parameter's description Escape-Code property.- Parameters:
aParamDescriptionEscCode
- The parameter's description Escape-Code to be stored by the parameter's description Escape-Code property.
-
setParameterEscapeCode
void setParameterEscapeCode(java.lang.String aParamEscCode)
Sets the parameter Escape-Code for the parameter Escape-Code property.- Parameters:
aParamEscCode
- The parameter Escape-Code to be stored by the parameter Escape-Code property.
-
setBannerEscapeCode
void setBannerEscapeCode(java.lang.String aBannerEscCode)
Sets the banner's content Escape-Code for the banner Escape-Code property.- Parameters:
aBannerEscCode
- The banner Escape-Code to be stored by the banner Escape-Code property.
-
setLineSeparatorEscapeCode
void setLineSeparatorEscapeCode(java.lang.String aLineSeparatorEscCode)
Sets the line separator Escape-Code for the line separator Escape-Code property.- Parameters:
aLineSeparatorEscCode
- The line separator Escape-Code to be stored by the line separator Escape-Code property.
-
setBannerBorderEscapeCode
void setBannerBorderEscapeCode(java.lang.String aBannerBorderEscCode)
Sets the banner's border Escape-Code for the banner border Escape-Code property.- Parameters:
aBannerBorderEscCode
- The banner border Escape-Code to be stored by the banner border Escape-Code property.
-
setSeparatorChar
void setSeparatorChar(char aSeparatorChar)
Set the character to be used when printing a separator line with theprintSeparatorLn()
method.- Parameters:
aSeparatorChar
- The character used by theprintSeparatorLn()
method when printing out the line of characters..
-
setStandardOut
void setStandardOut(java.io.PrintStream aStandardOut)
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aStandardOut
- The standard outPrintStream
to set.
-
setSyntaxNotation
void setSyntaxNotation(SyntaxNotation aSyntaxNotation)
Set theSyntaxNotation
.- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to set.
-
setUsageLabel
void setUsageLabel(java.lang.String aUsageLabel)
Set the usage label used by theprintHelp()
method when writing out the syntax.- Parameters:
aUsageLabel
- The usage label printed out by theprintHelp()
method.
-
withBannerFont
default ArgsParser withBannerFont(org.refcodes.textual.Font aBannerFont)
With banner font.- Parameters:
aBannerFont
- the banner font- Returns:
- the args parser
-
withBannerFontPalette
default ArgsParser withBannerFontPalette(char[] aColorPalette)
With banner font palette.- Parameters:
aColorPalette
- the color palette- Returns:
- the args parser
-
withConsoleWidth
default ArgsParser withConsoleWidth(int aConsoleWidth)
Set the console with. A setting of "-1" makes the instance use theSystemUtility.getTerminalWidth()
value.- Parameters:
aConsoleWidth
- The width to set.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withCopyrightNote
default ArgsParser withCopyrightNote(java.lang.String aCopyrightNote)
Set the copyright note used by theprintHelp()
method when writing out the copyright claim and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aCopyrightNote
- The license note printed out by theprintHelp()
method.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withDescription
default ArgsParser withDescription(java.lang.String aDescription)
With description.- Specified by:
withDescription
in interfaceorg.refcodes.mixin.DescriptionAccessor.DescriptionBuilder<ArgsParser>
- Parameters:
aDescription
- the description- Returns:
- the args parser
-
withErrorOut
default ArgsParser withErrorOut(java.io.PrintStream aErrorOut)
Set the error outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aErrorOut
- The error outPrintStream
to set.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withEscapeCodesEnabled
default ArgsParser withEscapeCodesEnabled(boolean isEscCodeEnabled)
- Specified by:
withEscapeCodesEnabled
in interfaceorg.refcodes.mixin.EscapeCodesStatusAccessor.EscapeCodeStatusBuilder<ArgsParser>
-
withEvalArgs
default ArgsParser withEvalArgs(java.util.List<java.lang.String> aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsException
Same asevalArgs(List)
with the difference that this class's instance being invoked is returned as of the builder pattern.- Parameters:
aArgs
- The command line arguments to be evaluated.- Returns:
- This invoked instance as of the builder pattern to chain method calls.
- 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
-
withEvalArgs
default ArgsParser withEvalArgs(java.lang.String[] aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsException
Same asevalArgs(String[])
with the difference that this class's instance being invoked is returned as of the builder pattern.- Parameters:
aArgs
- The command line arguments to be evaluated.- Returns:
- This invoked instance as of the builder pattern to chain method calls.
- 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
-
withLicenseNote
default ArgsParser withLicenseNote(java.lang.String aLicenseNote)
Set the license note used by theprintHelp()
method when writing out the licensing conditions and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aLicenseNote
- The license note printed out by theprintHelp()
method.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withLineBreak
default ArgsParser withLineBreak(java.lang.String aLineBreak)
Set the console's line break. A setting of null makes the instance use theSystemUtility.getLineBreak()
value.- Parameters:
aLineBreak
- the line break- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withMaxConsoleWidth
default ArgsParser withMaxConsoleWidth(int aMaxConsoleWidth)
Set the maximum console width to use in case the console width is greater than the maximum you want. This is most useful when the console width is determined automatically to be the width of your terminal.- Parameters:
aMaxConsoleWidth
- the max console width- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withName
default ArgsParser withName(java.lang.String aName)
With name.- Specified by:
withName
in interfaceorg.refcodes.mixin.NameAccessor.NameBuilder<ArgsParser>
- Parameters:
aName
- the name- Returns:
- the args parser
-
withParameterDescriptionEscapeCode
default ArgsParser withParameterDescriptionEscapeCode(java.lang.String aParamDescriptionEscCode)
Sets the parameter's description Escape-Code for the parameter's description Escape-Code property.- Parameters:
aParamDescriptionEscCode
- The parameter's description Escape-Code to be stored by the parameter's description Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withParameterEscapeCode
default ArgsParser withParameterEscapeCode(java.lang.String aParamEscCode)
Sets the parameter Escape-Code for the parameter Escape-Code property.- Parameters:
aParamEscCode
- The parameter Escape-Code to be stored by the parameter Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withBannerEscapeCode
default ArgsParser withBannerEscapeCode(java.lang.String aBannerEscCode)
Sets the banner's content Escape-Code for the banner Escape-Code property.- Parameters:
aBannerEscCode
- The banner Escape-Code to be stored by the banner Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withLineSeparatorEscapeCode
default ArgsParser withLineSeparatorEscapeCode(java.lang.String aLineSeparatorEscCode)
Sets the line separator Escape-Code for the line separator Escape-Code property.- Parameters:
aLineSeparatorEscCode
- The line separator Escape-Code to be stored by the line separator Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withBannerBorderEscapeCode
default ArgsParser withBannerBorderEscapeCode(java.lang.String aBannerBorderEscCode)
Sets the banner's border Escape-Code for the banner border Escape-Code property.- Parameters:
aBannerBorderEscCode
- The banner border Escape-Code to be stored by the banner border Escape-Code property.- Returns:
- The builder for applying multiple build operations.
-
withParseArgs
default ArgsParser withParseArgs(java.lang.String[] aArgs) throws UnknownArgsException, AmbiguousArgsException, SuperfluousArgsException, ParseArgsException
CallsevalArgs(String[])
and returns this invoked instance as of the builder pattern. Evaluates the provided command line arguments.- Specified by:
withParseArgs
in interfaceArgsParserMixin<ArgsParser>
- Parameters:
aArgs
- The command line arguments to be evaluated.- Returns:
- This instance as of the builder pattern to chain further method calls.
- 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
-
withResetEscapeCode
default ArgsParser withResetEscapeCode(java.lang.String aResetEscCode)
- Specified by:
withResetEscapeCode
in interfaceorg.refcodes.mixin.ResetEscapeCodeAccessor.ResetEscapeCodeBuilder<ArgsParser>
-
withSeparatorChar
default ArgsParser withSeparatorChar(char aSeparatorChar)
Set the character to be used when printing a separator line with theprintSeparatorLn()
method.- Parameters:
aSeparatorChar
- The character used by theprintSeparatorLn()
method when printing out the line of characters..- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withStandardOut
default ArgsParser withStandardOut(java.io.PrintStream aStandardOut)
Set the standard outPrintStream
and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aStandardOut
- The standard outPrintStream
to set.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withSyntaxNotation
default ArgsParser withSyntaxNotation(SyntaxNotation aSyntaxNotation)
Set theSyntaxNotation
and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to set.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
withTitle
default ArgsParser withTitle(java.lang.String aTitle)
With title.- Specified by:
withTitle
in interfaceorg.refcodes.mixin.TitleAccessor.TitleBuilder<ArgsParser>
- Parameters:
aTitle
- the title- Returns:
- the args parser
-
withUsageLabel
default ArgsParser withUsageLabel(java.lang.String aUsageLabel)
Set the usage label used by theprintHelp()
method when writing out the syntax and make other adjustments with the result (with regards to the Builder-Pattern).- Parameters:
aUsageLabel
- The usage label printed out by theprintHelp()
method.- Returns:
- This
ArgsParser
instance with regard to the builder pattern.
-
-