- java.lang.Object
-
- org.refcodes.archetype.CliHelper.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CliHelper.Builder
addExampleUsage(String aDescription, org.refcodes.cli.Operand<?>... aOperands)
Builder method adding an application'sExample
element.CliHelper.Builder
addExampleUsage(org.refcodes.cli.Example aExamples)
Builder method adding an application'sExample
element.CliHelper
build()
Creates a newCliHelper
using the configured properties.CliHelper.Builder
withArgs(String[] aArgs)
Builder method providing the application's command line arguments.CliHelper.Builder
withArgs(List<String> aArgs)
Builder method providing the application's command line arguments.CliHelper.Builder
withArgsSyntax(org.refcodes.cli.ArgsSyntax aArgsSyntax)
Builder method providing the application's command line syntax.CliHelper.Builder
withBannerFont(org.refcodes.textual.Font aBannerFont)
Builder method providing the application's banner font.CliHelper.Builder
withBannerPalette(char[] aBannerPalette)
Builder method providing the application's banner ASCII palette.CliHelper.Builder
withBannerPalette(org.refcodes.data.AsciiColorPalette aBannerPalette)
Builder method providing the application's banner ASCII palette.CliHelper.Builder
withConfigLocator(org.refcodes.runtime.ConfigLocator aConfigLocator)
Builder method providing theConfigLocator
when doing a lookup of the configuration file.CliHelper.Builder
withCopyright(String aCopyright)
Builder method providing the application's copyright.CliHelper.Builder
withDefaultConfig(String aDefaultConfig)
Builder method providing the application's configuration file path.CliHelper.Builder
withDescription(String aDescription)
Builder method providing the application's description property.CliHelper.Builder
withExamples(Collection<org.refcodes.cli.Example> aExamples)
Builder method providing the application'sExample
elements.CliHelper.Builder
withExamples(org.refcodes.cli.Example[] aExamples)
Builder method providing the application'sExample
elements.CliHelper.Builder
withLicenseNote(String aLicenseNote)
Builder method providing the application's license.CliHelper.Builder
withLogger(org.refcodes.logger.RuntimeLogger aLogger)
Builder method providing the application'sRuntimeLogger
.CliHelper.Builder
withName(String aAppName)
Builder method providing the application's name property.CliHelper.Builder
withResourceLocator(Class<?> aResourceLocator)
Builder method providing theClass
when doing a lookup of a (module specific) resource.CliHelper.Builder
withSyntaxNotation(org.refcodes.cli.SyntaxNotation aSyntaxNotation)
Builder method setting theSyntaxNotation
.CliHelper.Builder
withTitle(String aTitle)
Builder method providing the application's description property.CliHelper.Builder
withVerboseFallback(boolean aVerboseFallback)
Builder method providing the application's verbose fallback property.
-
-
-
Method Detail
-
addExampleUsage
public CliHelper.Builder addExampleUsage(org.refcodes.cli.Example aExamples)
Builder method adding an application'sExample
element.- Parameters:
aExamples
- The application'sExample
element to be added.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
addExampleUsage
public CliHelper.Builder addExampleUsage(String aDescription, org.refcodes.cli.Operand<?>... aOperands)
Builder method adding an application'sExample
element.- Parameters:
aDescription
- The example's description.aOperands
- The command line arguments required by the example.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withName
public CliHelper.Builder withName(String aAppName)
Builder method providing the application's name property.- Parameters:
aAppName
- The application's name.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withConfigLocator
public CliHelper.Builder withConfigLocator(org.refcodes.runtime.ConfigLocator aConfigLocator)
Builder method providing theConfigLocator
when doing a lookup of the configuration file.- Parameters:
aConfigLocator
- The application'sConfigLocator
.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withResourceLocator
public CliHelper.Builder withResourceLocator(Class<?> aResourceLocator)
Builder method providing theClass
when doing a lookup of a (module specific) resource.- Parameters:
aResourceLocator
- The application'sClass
which to use when loading resources (of the according module) by invokingClass.getResourceAsStream(String)
.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withSyntaxNotation
public CliHelper.Builder withSyntaxNotation(org.refcodes.cli.SyntaxNotation aSyntaxNotation)
Builder method setting theSyntaxNotation
.- Parameters:
aSyntaxNotation
- TheSyntaxNotation
to use.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withArgs
public CliHelper.Builder withArgs(String[] aArgs)
Builder method providing the application's command line arguments.- Parameters:
aArgs
- The application's command line arguments.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withArgs
public CliHelper.Builder withArgs(List<String> aArgs)
Builder method providing the application's command line arguments.- Parameters:
aArgs
- The application's command line arguments.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withArgsSyntax
public CliHelper.Builder withArgsSyntax(org.refcodes.cli.ArgsSyntax aArgsSyntax)
Builder method providing the application's command line syntax.- Parameters:
aArgsSyntax
- The application's command line syntax.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withBannerFont
public CliHelper.Builder withBannerFont(org.refcodes.textual.Font aBannerFont)
Builder method providing the application's banner font.- Parameters:
aBannerFont
- The application's banner font.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withBannerPalette
public CliHelper.Builder withBannerPalette(org.refcodes.data.AsciiColorPalette aBannerPalette)
Builder method providing the application's banner ASCII palette.- Parameters:
aBannerPalette
- The application's banner ASCII palette.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withBannerPalette
public CliHelper.Builder withBannerPalette(char[] aBannerPalette)
Builder method providing the application's banner ASCII palette.- Parameters:
aBannerPalette
- The application's banner ASCII palette.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withDefaultConfig
public CliHelper.Builder withDefaultConfig(String aDefaultConfig)
Builder method providing the application's configuration file path.- Parameters:
aDefaultConfig
- The application's configuration file path.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withCopyright
public CliHelper.Builder withCopyright(String aCopyright)
Builder method providing the application's copyright.- Parameters:
aCopyright
- The application's copyright.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withDescription
public CliHelper.Builder withDescription(String aDescription)
Builder method providing the application's description property.- Parameters:
aDescription
- The application's description.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withExamples
public CliHelper.Builder withExamples(Collection<org.refcodes.cli.Example> aExamples)
Builder method providing the application'sExample
elements.- Parameters:
aExamples
- The application'sExample
elements to use.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withExamples
public CliHelper.Builder withExamples(org.refcodes.cli.Example[] aExamples)
Builder method providing the application'sExample
elements.- Parameters:
aExamples
- The application'sExample
.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withLicenseNote
public CliHelper.Builder withLicenseNote(String aLicenseNote)
Builder method providing the application's license.- Parameters:
aLicenseNote
- The application's license.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withLogger
public CliHelper.Builder withLogger(org.refcodes.logger.RuntimeLogger aLogger)
Builder method providing the application'sRuntimeLogger
.- Parameters:
aLogger
- The application'sRuntimeLogger
.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withTitle
public CliHelper.Builder withTitle(String aTitle)
Builder method providing the application's description property.- Parameters:
aTitle
- The application's title (used when printing the banner).- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
withVerboseFallback
public CliHelper.Builder withVerboseFallback(boolean aVerboseFallback)
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).- Parameters:
aVerboseFallback
- The fallback verbose mode if the verbose mode cannot be determined otherwise.- Returns:
- This
CliHelper.Builder
as of the builder pattern.
-
-