java.lang.Object
org.refcodes.archetype.CliHelper.Builder
org.refcodes.archetype.AppHelper.Builder
- Enclosing class:
- AppHelper
Builder to build
CliHelper
.-
Field Summary
Fields inherited from class org.refcodes.archetype.CliHelper.Builder
appName, args, argsSyntax, bannerFont, bannerFontPalette, configLocator, copyrightNote, defaultConfig, description, exampleUsages, licenseNote, logger, longOptionPrefix, passwordPrompt, resourceLocator, shortOptionPrefix, shutDownHook, syntaxNotation, title, verboseFallback
-
Method Summary
Modifier and TypeMethodDescriptionaddExampleUsage
(String aDescription, org.refcodes.cli.Operand<?>... aOperands) Builder method adding an application'sExample
element.addExampleUsage
(org.refcodes.cli.Example aExamples) Builder method adding an application'sExample
element.build()
Creates a newCliHelper
using the configured properties.Builder method providing the application's command line arguments.Builder method providing the application's command line arguments.withArgsSyntax
(org.refcodes.cli.Constituent aArgsSyntax) Builder method providing the application's command line syntax.withBannerFont
(org.refcodes.textual.Font aBannerFont) Builder method providing the application's banner font.withBannerFontPalette
(char[] aBannerFontPalette) Builder method providing the application's banner ASCII palette.withBannerFontPalette
(org.refcodes.data.AsciiColorPalette aBannerFontPalette) Builder method providing the application's banner ASCII palette.withConfigLocator
(org.refcodes.runtime.ConfigLocator aConfigLocator) Builder method providing theConfigLocator
when doing a lookup of the configuration file.withCopyrightNote
(String aCopyrightNote) Builder method providing the application's copyright.withDefaultConfig
(String aDefaultConfig) Builder method providing the application's configuration file path.withDescription
(String aDescription) Builder method providing the application's description property.withExamples
(Collection<org.refcodes.cli.Example> aExamples) Builder method providing the application'sExample
elements.withExamples
(org.refcodes.cli.Example[] aExamples) Builder method providing the application'sExample
elements.withLicenseNote
(String aLicenseNote) Builder method providing the application's license.withLogger
(org.refcodes.logger.RuntimeLogger aLogger) Builder method providing the application'sRuntimeLogger
.Builder method providing the application's name property.withPasswordPrompt
(String aPasswordPrompt) Builder method providing the application's default password prompt.withResourceLocator
(Class<?> aResourceLocator) Builder method providing theClass
when doing a lookup of a (module specific) resource.withShutDownHook
(Consumer<Integer> aShutDownHook) Builder method providing an (optional) shutdown hook: When provided, then this hook is called instead ofSystem.exit(int)
(it is up to the shutdown hook to terminate the application in the end).withSyntaxNotation
(org.refcodes.cli.SyntaxNotation aSyntaxNotation) Builder method setting theSyntaxNotation
.Builder method providing the application's description property.withVerboseFallback
(boolean aVerboseFallback) Builder method providing the application's verbose fallback property.Methods inherited from class org.refcodes.archetype.CliHelper.Builder
withArgs, withArgs, withArgs, withArgs
-
Method Details
-
addExampleUsage
Builder method adding an application'sExample
element.- Overrides:
addExampleUsage
in classCliHelper.Builder
- Parameters:
aExamples
- The application'sExample
element to be added.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
addExampleUsage
public AppHelper.Builder addExampleUsage(String aDescription, org.refcodes.cli.Operand<?>... aOperands) Builder method adding an application'sExample
element.- Overrides:
addExampleUsage
in classCliHelper.Builder
- Parameters:
aDescription
- The example's description.aOperands
- The command line arguments required by the example.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withName
Builder method providing the application's name property.- Overrides:
withName
in classCliHelper.Builder
- Parameters:
aAppName
- The application's name.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withPasswordPrompt
Builder method providing the application's default password prompt.- Overrides:
withPasswordPrompt
in classCliHelper.Builder
- Parameters:
aPasswordPrompt
- The application's default password prompt.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withConfigLocator
Builder method providing theConfigLocator
when doing a lookup of the configuration file.- Overrides:
withConfigLocator
in classCliHelper.Builder
- Parameters:
aConfigLocator
- The application'sConfigLocator
.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withResourceLocator
Builder method providing theClass
when doing a lookup of a (module specific) resource.- Overrides:
withResourceLocator
in classCliHelper.Builder
- Parameters:
aResourceLocator
- The application'sClass
which to use when loading resources (of the according module) by invokingClass.getResourceAsStream(String)
.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withSyntaxNotation
Builder method setting theSyntaxNotation
.- Overrides:
withSyntaxNotation
in classCliHelper.Builder
- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to use.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withArgs
Builder method providing the application's command line arguments.- Overrides:
withArgs
in classCliHelper.Builder
- Parameters:
aArgs
- The application's command line arguments.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withArgs
Builder method providing the application's command line arguments.- Overrides:
withArgs
in classCliHelper.Builder
- Parameters:
aArgs
- The application's command line arguments.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withArgsSyntax
Builder method providing the application's command line syntax.- Overrides:
withArgsSyntax
in classCliHelper.Builder
- Parameters:
aArgsSyntax
- The application's command line syntax.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withBannerFont
Builder method providing the application's banner font.- Overrides:
withBannerFont
in classCliHelper.Builder
- Parameters:
aBannerFont
- The application's banner font.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withBannerFontPalette
public AppHelper.Builder withBannerFontPalette(org.refcodes.data.AsciiColorPalette aBannerFontPalette) Builder method providing the application's banner ASCII palette.- Overrides:
withBannerFontPalette
in classCliHelper.Builder
- Parameters:
aBannerFontPalette
- The application's banner ASCII palette.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withBannerFontPalette
Builder method providing the application's banner ASCII palette.- Overrides:
withBannerFontPalette
in classCliHelper.Builder
- Parameters:
aBannerFontPalette
- The application's banner ASCII palette.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withDefaultConfig
Builder method providing the application's configuration file path.- Overrides:
withDefaultConfig
in classCliHelper.Builder
- Parameters:
aDefaultConfig
- The application's configuration file path.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withCopyrightNote
Builder method providing the application's copyright.- Overrides:
withCopyrightNote
in classCliHelper.Builder
- Parameters:
aCopyrightNote
- The application's copyright.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withDescription
Builder method providing the application's description property.- Overrides:
withDescription
in classCliHelper.Builder
- Parameters:
aDescription
- The application's description.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withExamples
Builder method providing the application'sExample
elements.- Overrides:
withExamples
in classCliHelper.Builder
- Parameters:
aExamples
- The application'sExample
elements to use.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withExamples
Builder method providing the application'sExample
elements.- Overrides:
withExamples
in classCliHelper.Builder
- Parameters:
aExamples
- The application'sExample
.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withLicenseNote
Builder method providing the application's license.- Overrides:
withLicenseNote
in classCliHelper.Builder
- Parameters:
aLicenseNote
- The application's license.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withLogger
Builder method providing the application'sRuntimeLogger
.- Overrides:
withLogger
in classCliHelper.Builder
- Parameters:
aLogger
- The application'sRuntimeLogger
.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withShutDownHook
Builder method providing an (optional) shutdown hook: When provided, then this hook is called instead ofSystem.exit(int)
(it is up to the shutdown hook to terminate the application in the end).- Overrides:
withShutDownHook
in classCliHelper.Builder
- Parameters:
aShutDownHook
- The (optional) shutdown hook.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withTitle
Builder method providing the application's description property.- Overrides:
withTitle
in classCliHelper.Builder
- Parameters:
aTitle
- The application's title (used when printing the banner).- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
withVerboseFallback
Builder method providing the application's verbose fallback property. In case noVerboseFlag
neitherQuietFlag
parsers are present and no "verbose" neither "quiet" value are found in the properties, then this value is used as a fallback, either to be "more verbose" (true) or "more quiet" (false).- Overrides:
withVerboseFallback
in classCliHelper.Builder
- Parameters:
aVerboseFallback
- The fallback verbose mode if the verbose mode cannot be determined otherwise.- Returns:
- This
AppHelper.Builder
as of the builder pattern.
-
build
Creates a newCliHelper
using the configured properties.- Overrides:
build
in classCliHelper.Builder
- Returns:
- The accordingly configured
CliHelper
.
-